#[non_exhaustive]pub struct MediaLimits {
pub max_packet_bytes: usize,
pub max_tracks: u32,
pub max_header_bytes: u64,
pub max_table_entries: u64,
pub max_queued_packets: usize,
pub max_queued_frames: usize,
}Expand description
Caps on container structure and queue depth.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_packet_bytes: usizeLargest packet payload, in bytes.
max_tracks: u32Most tracks one container may declare.
max_header_bytes: u64Most header bytes read before the first packet.
max_table_entries: u64Most entries in an index or sample table.
max_queued_packets: usizeMost packets queued between two stages.
max_queued_frames: usizeMost decoded frames a codec session holds for output.
Implementations§
Source§impl MediaLimits
impl MediaLimits
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
Untrusted-input defaults: 64 MiB packets, 64 tracks, 256 MiB of headers, 4 Mi table entries, 64 queued packets, 8 queued frames.
Sourcepub const fn with_max_packet_bytes(self, n: usize) -> Self
pub const fn with_max_packet_bytes(self, n: usize) -> Self
The largest packet payload.
Sourcepub const fn with_max_tracks(self, n: u32) -> Self
pub const fn with_max_tracks(self, n: u32) -> Self
The most tracks.
Sourcepub const fn with_max_header_bytes(self, n: u64) -> Self
pub const fn with_max_header_bytes(self, n: u64) -> Self
The most header bytes.
Sourcepub const fn with_max_table_entries(self, n: u64) -> Self
pub const fn with_max_table_entries(self, n: u64) -> Self
The most index or table entries.
Sourcepub const fn with_max_queued_packets(self, n: usize) -> Self
pub const fn with_max_queued_packets(self, n: usize) -> Self
The most queued packets.
Sourcepub const fn with_max_queued_frames(self, n: usize) -> Self
pub const fn with_max_queued_frames(self, n: usize) -> Self
The most queued frames.
Sourcepub fn check_packet_bytes(&self, bytes: u64) -> Result<(), MediaLimitExceeded>
pub fn check_packet_bytes(&self, bytes: u64) -> Result<(), MediaLimitExceeded>
Sourcepub fn check_tracks(&self, tracks: u64) -> Result<(), MediaLimitExceeded>
pub fn check_tracks(&self, tracks: u64) -> Result<(), MediaLimitExceeded>
Sourcepub fn check_header_bytes(&self, bytes: u64) -> Result<(), MediaLimitExceeded>
pub fn check_header_bytes(&self, bytes: u64) -> Result<(), MediaLimitExceeded>
Sourcepub fn check_table_entries(
&self,
entries: u64,
) -> Result<(), MediaLimitExceeded>
pub fn check_table_entries( &self, entries: u64, ) -> Result<(), MediaLimitExceeded>
Trait Implementations§
Source§impl Clone for MediaLimits
impl Clone for MediaLimits
Source§fn clone(&self) -> MediaLimits
fn clone(&self) -> MediaLimits
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 MediaLimits
Source§impl Debug for MediaLimits
impl Debug for MediaLimits
Source§impl Default for MediaLimits
impl Default for MediaLimits
impl Eq for MediaLimits
Source§impl PartialEq for MediaLimits
impl PartialEq for MediaLimits
impl StructuralPartialEq for MediaLimits
Auto Trait Implementations§
impl Freeze for MediaLimits
impl RefUnwindSafe for MediaLimits
impl Send for MediaLimits
impl Sync for MediaLimits
impl Unpin for MediaLimits
impl UnsafeUnpin for MediaLimits
impl UnwindSafe for MediaLimits
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