pub struct Sender<E> { /* private fields */ }Expand description
Sender side of the byte stream.
Clones share one readiness registration. If several clones poll readiness, the most recently registered task is the one that will be woken.
Implementations§
Source§impl<E> Sender<E>
impl<E> Sender<E>
Sourcepub fn feed_data(&self, data: Bytes)
pub fn feed_data(&self, data: Bytes)
Adds a chunk to the stream.
This method does not enforce the configured backpressure threshold.
Sourcepub async fn ready(&self) -> Status
pub async fn ready(&self) -> Status
Waits until the stream needs more data or reaches a terminal state.
Sourcepub fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Status>
pub fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Status>
Polls until the stream needs more data or reaches a terminal state.
Terminal states take precedence: Status::Dropped is returned once
the receiver is gone or an error was set, Status::Eof after EOF.
Trait Implementations§
Auto Trait Implementations§
impl<E> !RefUnwindSafe for Sender<E>
impl<E> !Send for Sender<E>
impl<E> !Sync for Sender<E>
impl<E> !UnwindSafe for Sender<E>
impl<E> Freeze for Sender<E>
impl<E> Unpin for Sender<E>
impl<E> UnsafeUnpin for Sender<E>
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