Enum DispatchState
pub(crate) enum DispatchState {
NotStarted {
cmd_tx: Sender<Command>,
command: Command,
},
Reserving(Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>),
Sent,
}Available on crate feature
tokio only.Expand description
State of a future before its command has been pushed onto the event-loop channel.
Owns a cloned Command sender rather than borrowing the client, so the
operation futures are 'static and can be tokio::spawned or stored.
Variants§
NotStarted
First poll has not yet happened. The command is built but not yet sent.
Command is an enum, so it is stored inline without a Box.
Reserving(Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>)
Waiting for a permit on the bounded command channel.
Sent
Command has been pushed and there is nothing left to dispatch.
Implementations§
§impl DispatchState
impl DispatchState
pub(crate) const fn new(cmd_tx: Sender<Command>, command: Command) -> Self
pub(crate) fn poll_dispatch(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
pub(crate) fn poll_dispatch( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Drives dispatch until the command has been pushed onto the channel.
Returns Ready(Ok(())) once the command has been sent (or was
already sent), Ready(Err(_)) on permanent failure, or Pending
while waiting for channel capacity.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DispatchState
impl !Sync for DispatchState
impl !UnwindSafe for DispatchState
impl Freeze for DispatchState
impl Send for DispatchState
impl Unpin for DispatchState
impl UnsafeUnpin for DispatchState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more