pub enum BackpressureSignal {
Ok,
SlowDown,
Pause,
}Expand description
Signal indicating client’s receive buffer state for backpressure control
Clients send backpressure signals to inform the server about their processing capacity. The server uses these signals to throttle or pause frame transmission.
Variants§
Ok
Client is ready for more data, no throttling needed
SlowDown
Client’s buffer is filling up, server should slow down transmission
Pause
Client’s buffer is full, server must pause transmission
Implementations§
Source§impl BackpressureSignal
impl BackpressureSignal
Sourcepub fn should_pause(&self) -> bool
pub fn should_pause(&self) -> bool
Returns true if this signal indicates the server should pause
Sourcepub fn should_throttle(&self) -> bool
pub fn should_throttle(&self) -> bool
Returns true if this signal indicates the server should slow down
Sourcepub fn suggested_delay_ms(&self) -> u64
pub fn suggested_delay_ms(&self) -> u64
Get suggested delay in milliseconds based on backpressure signal
Trait Implementations§
Source§impl Clone for BackpressureSignal
impl Clone for BackpressureSignal
Source§fn clone(&self) -> BackpressureSignal
fn clone(&self) -> BackpressureSignal
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 moreSource§impl Debug for BackpressureSignal
impl Debug for BackpressureSignal
Source§impl Default for BackpressureSignal
impl Default for BackpressureSignal
Source§fn default() -> BackpressureSignal
fn default() -> BackpressureSignal
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BackpressureSignal
impl<'de> Deserialize<'de> for BackpressureSignal
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BackpressureSignal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BackpressureSignal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BackpressureSignal
impl Display for BackpressureSignal
Source§impl PartialEq for BackpressureSignal
impl PartialEq for BackpressureSignal
Source§impl Serialize for BackpressureSignal
impl Serialize for BackpressureSignal
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BackpressureSignal
impl Eq for BackpressureSignal
impl StructuralPartialEq for BackpressureSignal
Auto Trait Implementations§
impl Freeze for BackpressureSignal
impl RefUnwindSafe for BackpressureSignal
impl Send for BackpressureSignal
impl Sync for BackpressureSignal
impl Unpin for BackpressureSignal
impl UnwindSafe for BackpressureSignal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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