pub struct StreamLimits { /* private fields */ }Expand description
Hard byte, chunk, observation, and zero-progress limits.
Implementations§
Source§impl StreamLimits
impl StreamLimits
Sourcepub const fn new(
max_bytes: u64,
max_chunk_bytes: usize,
max_chunks: u32,
max_observations: u32,
max_consecutive_zero_progress: u16,
) -> Result<Self, StreamLimitsError>
pub const fn new( max_bytes: u64, max_chunk_bytes: usize, max_chunks: u32, max_observations: u32, max_consecutive_zero_progress: u16, ) -> Result<Self, StreamLimitsError>
Creates complete nonzero limits beneath global ceilings.
Sourcepub const fn max_chunk_bytes(self) -> usize
pub const fn max_chunk_bytes(self) -> usize
Returns the per-chunk byte ceiling.
Sourcepub const fn max_chunks(self) -> u32
pub const fn max_chunks(self) -> u32
Returns the source-chunk ceiling.
Sourcepub const fn max_observations(self) -> u32
pub const fn max_observations(self) -> u32
Returns the source, sink, and waiting observation ceiling.
Sourcepub const fn max_consecutive_zero_progress(self) -> u16
pub const fn max_consecutive_zero_progress(self) -> u16
Returns the admitted consecutive zero-progress observations.
Trait Implementations§
Source§impl Clone for StreamLimits
impl Clone for StreamLimits
Source§fn clone(&self) -> StreamLimits
fn clone(&self) -> StreamLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StreamLimits
Source§impl Debug for StreamLimits
impl Debug for StreamLimits
impl Eq for StreamLimits
Source§impl Hash for StreamLimits
impl Hash for StreamLimits
Source§impl Ord for StreamLimits
impl Ord for StreamLimits
Source§fn cmp(&self, other: &StreamLimits) -> Ordering
fn cmp(&self, other: &StreamLimits) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StreamLimits
impl PartialEq for StreamLimits
Source§impl PartialOrd for StreamLimits
impl PartialOrd for StreamLimits
impl StructuralPartialEq for StreamLimits
Auto Trait Implementations§
impl Freeze for StreamLimits
impl RefUnwindSafe for StreamLimits
impl Send for StreamLimits
impl Sync for StreamLimits
impl Unpin for StreamLimits
impl UnsafeUnpin for StreamLimits
impl UnwindSafe for StreamLimits
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