#[non_exhaustive]pub struct Limits {
pub max_rate: u32,
pub max_frames: u64,
}Expand description
What a decoder may produce: a malformed or hostile file stops here, before it costs the memory it asks for.
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_rate: u32The highest rate, in samples a second.
max_frames: u64The most frames one source may yield.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const DEFAULT_MAX_RATE: u32 = 192_000
pub const DEFAULT_MAX_RATE: u32 = 192_000
The highest rate of the default limits.
Sourcepub const DEFAULT_MAX_FRAMES: u64
pub const DEFAULT_MAX_FRAMES: u64
The most frames of the default limits: about 25 minutes at 44.1 kHz, which is 256 MiB of stereo decoded whole.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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