pub struct FromStreamOptions {
pub chunk_size: NumBytes,
pub channel_capacity: usize,
}Expand description
NOTE: The maximum possible memory consumption is: chunk_size * channel_capacity.
Although reaching that level requires:
- A receiver to listen for chunks.
- The channel getting full.
Fields§
§chunk_size: NumBytesThe size of an individual chunk read from the read buffer in bytes.
Must be greater than zero.
default: 16 * 1024 // 16 kb
channel_capacity: usizeThe number of chunks held by the underlying async channel.
When the subscriber (if present) is not fast enough to consume chunks equally fast or faster
than them getting read, this acts as a buffer to hold not-yet processed messages.
The bigger, the better, in terms of system resilience to write-spikes.
Multiply with chunk_size to obtain the amount of system resources this will consume at
max.
Trait Implementations§
Source§impl Clone for FromStreamOptions
impl Clone for FromStreamOptions
Source§fn clone(&self) -> FromStreamOptions
fn clone(&self) -> FromStreamOptions
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 FromStreamOptions
impl Debug for FromStreamOptions
Source§impl Default for FromStreamOptions
impl Default for FromStreamOptions
Source§impl PartialEq for FromStreamOptions
impl PartialEq for FromStreamOptions
impl Copy for FromStreamOptions
impl Eq for FromStreamOptions
impl StructuralPartialEq for FromStreamOptions
Auto Trait Implementations§
impl Freeze for FromStreamOptions
impl RefUnwindSafe for FromStreamOptions
impl Send for FromStreamOptions
impl Sync for FromStreamOptions
impl Unpin for FromStreamOptions
impl UnsafeUnpin for FromStreamOptions
impl UnwindSafe for FromStreamOptions
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