pub(crate) struct PrioManager {
streams: HashMap<Sid, StreamInfo>,
metrics: ProtocolMetricCache,
}Expand description
Responsible for queueing messages.
every stream has a guaranteed bandwidth and a prio 0-7.
when n Bytes are available in the buffer, first the guaranteed bandwidth
is used. Then remaining bandwidth is used to fill up the prios.
Fields§
§streams: HashMap<Sid, StreamInfo>§metrics: ProtocolMetricCacheImplementations§
Source§impl PrioManager
impl PrioManager
pub fn new(metrics: ProtocolMetricCache) -> Self
pub fn open_stream( &mut self, sid: Sid, prio: Prio, promises: Promises, guaranteed_bandwidth: Bandwidth, )
pub fn try_close_stream(&mut self, sid: Sid) -> bool
pub fn is_empty(&self) -> bool
pub fn add(&mut self, buffer: Bytes, mid: u64, sid: Sid)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrioManager
impl !RefUnwindSafe for PrioManager
impl Send for PrioManager
impl Sync for PrioManager
impl Unpin for PrioManager
impl !UnwindSafe for PrioManager
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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