#[non_exhaustive]pub struct MemoryBudgets {
pub max_input_bytes: u64,
pub max_buffered_input_bytes: u64,
pub max_output_bytes: u64,
pub max_channels: u32,
pub max_metadata_bytes: u64,
pub max_index_entries: u32,
pub max_box_depth: u32,
pub max_workspace_bytes: u64,
pub max_declared_au_bytes: u32,
}Expand description
Named memory limits. Default is the speech-ingest set.
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_input_bytes: u64§max_buffered_input_bytes: u64§max_output_bytes: u64§max_channels: u32§max_metadata_bytes: u64§max_index_entries: u32§max_box_depth: u32§max_workspace_bytes: u64§max_declared_au_bytes: u32Implementations§
Source§impl MemoryBudgets
impl MemoryBudgets
Sourcepub fn unbounded_collection() -> Self
pub fn unbounded_collection() -> Self
Same fences as Default, but collected PCM uses u64::MAX / 2
so an unbounded-duration one-shot still cannot wrap the byte count.
Sourcepub fn validate(&self) -> Result<(), BudgetExceeded>
pub fn validate(&self) -> Result<(), BudgetExceeded>
Zero in any field disables the fence; reject that like TASK-21.
pub fn check_input_finite(&self, len: u64) -> Result<usize, BudgetExceeded>
pub fn check_buffered(&self, buffered: u64) -> Result<usize, BudgetExceeded>
pub fn check_declared_au(&self, len: u64) -> Result<usize, BudgetExceeded>
pub fn check_channels(&self, n: u32) -> Result<(), BudgetExceeded>
pub fn check_output( &self, channels: u32, samples: u64, ) -> Result<usize, BudgetExceeded>
pub fn check_index( &self, entries: u64, bytes_per_entry: u64, ) -> Result<usize, BudgetExceeded>
pub fn check_box_depth(&self, depth: u32) -> Result<(), BudgetExceeded>
pub fn check_workspace( &self, channels: u32, he: bool, ps: bool, ) -> Result<usize, BudgetExceeded>
Sourcepub fn effective_output_bytes(&self) -> u64
pub fn effective_output_bytes(&self) -> u64
32-bit hosts cannot Vec more than isize::MAX bytes.
Trait Implementations§
Source§impl Clone for MemoryBudgets
impl Clone for MemoryBudgets
impl Copy for MemoryBudgets
Source§impl Debug for MemoryBudgets
impl Debug for MemoryBudgets
Source§impl Default for MemoryBudgets
impl Default for MemoryBudgets
impl Eq for MemoryBudgets
Source§impl PartialEq for MemoryBudgets
impl PartialEq for MemoryBudgets
impl StructuralPartialEq for MemoryBudgets
Auto Trait Implementations§
impl Freeze for MemoryBudgets
impl RefUnwindSafe for MemoryBudgets
impl Send for MemoryBudgets
impl Sync for MemoryBudgets
impl Unpin for MemoryBudgets
impl UnsafeUnpin for MemoryBudgets
impl UnwindSafe for MemoryBudgets
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