pub struct SendBufferTracking<L> { /* private fields */ }
Expand description
Tracks the available send buffer space for a socket.
Implementations§
Source§impl<L> SendBufferTracking<L>
impl<L> SendBufferTracking<L>
Sourcepub fn new(capacity: PositiveIsize, listener: L) -> Self
pub fn new(capacity: PositiveIsize, listener: L) -> Self
Creates a new SendBufferTracking
with the initial available send
buffer space capacity
and a writable listener listener
.
Source§impl<L: SocketWritableListener> SendBufferTracking<L>
impl<L: SocketWritableListener> SendBufferTracking<L>
Sourcepub fn acquire(
&self,
bytes: PositiveIsize,
) -> Result<SendBufferSpace, SendBufferFullError>
pub fn acquire( &self, bytes: PositiveIsize, ) -> Result<SendBufferSpace, SendBufferFullError>
Acquires bytes
for send with this SendBufferTracking
instance.
Sourcepub fn release(&self, space: SendBufferSpace)
pub fn release(&self, space: SendBufferSpace)
Releases space
back to this SendBufferTracking
instance.
Sourcepub fn capacity(&self) -> PositiveIsize
pub fn capacity(&self) -> PositiveIsize
Returns the tracker’s capacity.
Sourcepub fn available(&self) -> Option<PositiveIsize>
pub fn available(&self) -> Option<PositiveIsize>
Returns the currently available buffer space.
Sourcepub fn set_capacity(&self, new_capacity: PositiveIsize)
pub fn set_capacity(&self, new_capacity: PositiveIsize)
Updates the tracker’s capacity to new_capacity
.
Note that upon changing the capacity the socket’s writable state may change.
Trait Implementations§
Auto Trait Implementations§
impl<L> !Freeze for SendBufferTracking<L>
impl<L> RefUnwindSafe for SendBufferTracking<L>
impl<L> Send for SendBufferTracking<L>where
L: Send,
impl<L> Sync for SendBufferTracking<L>where
L: Send,
impl<L> Unpin for SendBufferTracking<L>where
L: Unpin,
impl<L> UnwindSafe for SendBufferTracking<L>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more