pub struct SmfReadLimits {
pub max_file_bytes: usize,
pub max_header_bytes: usize,
pub max_tracks: usize,
pub max_track_bytes: usize,
pub max_events: usize,
pub max_event_payload_bytes: usize,
pub max_total_payload_bytes: usize,
}Expand description
Defensive resource bounds applied while parsing an SMF byte slice.
Limits are checked before capacity is reserved or a payload is copied.
read_smf uses Default limits; hosts accepting
untrusted files can choose tighter limits through
read_smf_with_limits.
Fields§
§max_file_bytes: usizeMaximum complete input size.
max_header_bytes: usizeMaximum declared header chunk body size.
max_tracks: usizeMaximum declared number of tracks.
max_track_bytes: usizeMaximum body size of one track chunk.
max_events: usizeMaximum total number of events across all tracks.
max_event_payload_bytes: usizeMaximum payload size of one meta or system-exclusive event.
max_total_payload_bytes: usizeMaximum aggregate payload bytes copied across all events.
Trait Implementations§
Source§impl Clone for SmfReadLimits
impl Clone for SmfReadLimits
Source§fn clone(&self) -> SmfReadLimits
fn clone(&self) -> SmfReadLimits
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 SmfReadLimits
Source§impl Debug for SmfReadLimits
impl Debug for SmfReadLimits
Source§impl Default for SmfReadLimits
impl Default for SmfReadLimits
impl Eq for SmfReadLimits
Source§impl PartialEq for SmfReadLimits
impl PartialEq for SmfReadLimits
impl StructuralPartialEq for SmfReadLimits
Auto Trait Implementations§
impl Freeze for SmfReadLimits
impl RefUnwindSafe for SmfReadLimits
impl Send for SmfReadLimits
impl Sync for SmfReadLimits
impl Unpin for SmfReadLimits
impl UnsafeUnpin for SmfReadLimits
impl UnwindSafe for SmfReadLimits
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