pub struct CreditSink<S: ChannelSink> { /* private fields */ }Expand description
A ChannelSink wrapper that enforces credit-based flow control.
Each send_payload acquires one permit from the semaphore, blocking if
credit is zero. The semaphore is shared with the driver so that incoming
GrantCredit messages can add permits via CreditSink::credit.
Implementations§
Source§impl<S: ChannelSink> CreditSink<S>
impl<S: ChannelSink> CreditSink<S>
Trait Implementations§
Source§impl<S: ChannelSink> ChannelSink for CreditSink<S>
Available on non-WebAssembly only.
impl<S: ChannelSink> ChannelSink for CreditSink<S>
Available on non-WebAssembly only.
fn send_payload<'payload>( &self, payload: Payload<'payload>, ) -> Pin<Box<dyn Future<Output = Result<(), TxError>> + Send + 'payload>>
fn close_channel( &self, metadata: Metadata<'_>, ) -> Pin<Box<dyn Future<Output = Result<(), TxError>> + Send + 'static>>
Source§fn close_channel_on_drop(&self)
fn close_channel_on_drop(&self)
Synchronous drop-time close signal. Read more
Auto Trait Implementations§
impl<S> Freeze for CreditSink<S>where
S: Freeze,
impl<S> RefUnwindSafe for CreditSink<S>where
S: RefUnwindSafe,
impl<S> Send for CreditSink<S>
impl<S> Sync for CreditSink<S>
impl<S> Unpin for CreditSink<S>where
S: Unpin,
impl<S> UnsafeUnpin for CreditSink<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for CreditSink<S>where
S: UnwindSafe,
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