Struct Channel
pub struct Channel<D, E = Infallible> { /* private fields */ }
A body backed by a channel.
Implementations
impl<D, E> Channel<D, E>
fn new(buffer: usize) -> (Sender<D, E>, Self)Create a new channel body.
The channel will buffer up to the provided number of messages. Once the buffer is full, attempts to send new messages will wait until a message is received from the channel. The provided buffer capacity must be at least 1.
Trait Implementations
impl<'__pin, D, E> Unpin for Channel<D, E>
where
PinnedFieldsOf<__Origin<'__pin, D, E>>: Unpin,
impl<D, E> Body for Channel<D, E>
where
D: Buf,
type Data = D;type Error = E;fn poll_frame(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
impl<D, E: Debug> Debug for Channel<D, E>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<D, E = never> !RefUnwindSafe for Channel<D, E>
impl<D, E = never> !UnwindSafe for Channel<D, E>
impl<D, E> Freeze for Channel<D, E>
where
Receiver<Frame<D>>: Freeze,
Receiver<E>: Freeze,
impl<D, E> Send for Channel<D, E>
where
Receiver<Frame<D>>: Send,
Receiver<E>: Send,
impl<D, E> Sync for Channel<D, E>
where
Receiver<Frame<D>>: Sync,
Receiver<E>: Sync,
impl<D, E> UnsafeUnpin for Channel<D, E>
where
Receiver<Frame<D>>: UnsafeUnpin,
Receiver<E>: UnsafeUnpin,
Blanket Implementations
impl<T> Any for Channel<D, E>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> BodyExt for Channel<D, E>
where
T: Body + ?Sized,
impl<T> Borrow<T> for Channel<D, E>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Channel<D, E>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Channel<D, E>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Channel<D, E>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Channel<D, E>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Channel<D, E>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>