pub struct Driver<S: Session> { /* private fields */ }Expand description
Drives a session with caller-supplied time.
Returned by crate::Client::connect and crate::Server::accept. Call
poll when external activity wakes the waiter or when the
returned deadline is reached, supplying nondecreasing instants; see
crate::time::Driver for the contract. Completion is cached, so
subsequent polls return the same error.
It holds no session handle: dropping the last crate::Session requests
closure on the next poll. Dropping the driver cancels the session, and
crate::Session::closed resolves with Error::Cancel. Its Send-ness
follows its transport.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Driver<S>
impl<S> !Sync for Driver<S>
impl<S> !UnwindSafe for Driver<S>
impl<S> Freeze for Driver<S>where
State<S>: Freeze,
impl<S> Send for Driver<S>where
State<S>: Send,
impl<S> Unpin for Driver<S>where
State<S>: Unpin,
impl<S> UnsafeUnpin for Driver<S>where
State<S>: UnsafeUnpin,
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