Struct capnp_futures::Sender [−][src]
A handle that allows message to be sent to a write queue`.
Implementations
impl<M> Sender<M> where
M: AsOutputSegments,
[src]
M: AsOutputSegments,
pub fn send(
&mut self,
message: M
) -> impl Future<Output = Result<M, Error>> + Unpin
[src]
&mut self,
message: M
) -> impl Future<Output = Result<M, Error>> + Unpin
Enqueues a message to be written. The returned future resolves once the write has completed.
pub fn len(&mut self) -> usize
[src]
Returns the number of messages queued to be written, not including any in-progress write.
pub fn terminate(
&mut self,
result: Result<(), Error>
) -> impl Future<Output = Result<(), Error>> + Unpin
[src]
&mut self,
result: Result<(), Error>
) -> impl Future<Output = Result<(), Error>> + Unpin
Commands the queue to stop writing messages once it is empty. After this method has been called,
any new calls to send()
will return a future that immediately resolves to an error.
If the passed-in result
is an error, then the WriteQueue
will resolve to that error.
Trait Implementations
impl<M> Clone for Sender<M> where
M: AsOutputSegments,
[src]
M: AsOutputSegments,
Auto Trait Implementations
impl<M> !RefUnwindSafe for Sender<M>
impl<M> Send for Sender<M> where
M: Send,
M: Send,
impl<M> Sync for Sender<M> where
M: Send,
M: Send,
impl<M> Unpin for Sender<M>
impl<M> !UnwindSafe for Sender<M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,