pub struct WriterHandle { /* private fields */ }Expand description
Handle for sending frames to the writer task.
This is cheaply cloneable and can be shared across multiple handlers.
Implementations§
Source§impl WriterHandle
impl WriterHandle
Sourcepub async fn send(&self, frame: OutboundFrame) -> Result<()>
pub async fn send(&self, frame: OutboundFrame) -> Result<()>
Send a frame to the writer task.
This method will wait if backpressure is active, timing out after the configured duration.
Sourcepub fn is_backpressure_active(&self) -> bool
pub fn is_backpressure_active(&self) -> bool
Check if backpressure is currently active.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get current pending frame count.
Sourcepub fn try_send(&self, frame: OutboundFrame) -> Result<()>
pub fn try_send(&self, frame: OutboundFrame) -> Result<()>
Try to send a frame without waiting for backpressure.
Returns Err(BackpressureTimeout) immediately if at capacity.
Trait Implementations§
Source§impl Clone for WriterHandle
impl Clone for WriterHandle
Source§fn clone(&self) -> WriterHandle
fn clone(&self) -> WriterHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WriterHandle
impl RefUnwindSafe for WriterHandle
impl Send for WriterHandle
impl Sync for WriterHandle
impl Unpin for WriterHandle
impl UnwindSafe for WriterHandle
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