pub struct StreamReaderOptions {
pub max_descriptor_bytes: u64,
pub max_buffer_bytes: u64,
pub enforce_cross_machine_sync: bool,
pub max_composite_depth: usize,
}Expand description
The limits a reader enforces on an untrusted stream.
Held by StreamReaderCore and by every driver over it, so
a C consumer and an event loop enforce the same ceilings.
§Examples
use hurray_io::stream::{StreamReaderOptions, DEFAULT_MAX_COMPOSITE_DEPTH};
let options = StreamReaderOptions {
max_buffer_bytes: 1 << 30,
..Default::default()
};
assert_eq!(options.max_composite_depth, DEFAULT_MAX_COMPOSITE_DEPTH);Fields§
§max_descriptor_bytes: u64Maximum byte length of a single descriptor. Default: 16 MiB.
max_buffer_bytes: u64Maximum byte length of a single buffer. Default: u64::MAX (unbounded).
enforce_cross_machine_sync: boolReject buffers whose sync_mode is not
ProducerSynced.
Enable when the stream crosses machine boundaries.
max_composite_depth: usizeMaximum composite nesting depth. Default: DEFAULT_MAX_COMPOSITE_DEPTH.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamReaderOptions
impl RefUnwindSafe for StreamReaderOptions
impl Send for StreamReaderOptions
impl Sync for StreamReaderOptions
impl Unpin for StreamReaderOptions
impl UnsafeUnpin for StreamReaderOptions
impl UnwindSafe for StreamReaderOptions
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