pub enum PreallocationLimitOverride {
UseConfig,
NoLimit,
Override(usize),
}Expand description
SeqLen level override of configured preallocation size limit.
Variants§
UseConfig
Use the configuration’s preallocation size limit.
NoLimit
Override with no limit.
Override(usize)
Override with a specific limit, in bytes.
Implementations§
Source§impl PreallocationLimitOverride
impl PreallocationLimitOverride
Sourcepub const fn to_opt_limit_with_config<C: ConfigCore>(self) -> Option<usize>
pub const fn to_opt_limit_with_config<C: ConfigCore>(self) -> Option<usize>
Convert the given PreallocationLimitOverride to an Option<usize>,
reconciling with the given configuration.
If the override is PreallocationLimitOverride::UseConfig, then the
configuration’s preallocation size limit is returned.
If the override is PreallocationLimitOverride::NoLimit, then None is returned.
Otherwise, the override is returned.
Sourcepub const fn from_usize(limit: usize) -> Self
pub const fn from_usize(limit: usize) -> Self
Convert a raw preallocation usize value to a PreallocationLimitOverride.
Handles special case values PREALLOCATION_SIZE_LIMIT_USE_CONFIG and
PREALLOCATION_SIZE_LIMIT_DISABLED.
Trait Implementations§
Source§impl Clone for PreallocationLimitOverride
impl Clone for PreallocationLimitOverride
impl Copy for PreallocationLimitOverride
Source§impl Debug for PreallocationLimitOverride
impl Debug for PreallocationLimitOverride
Source§impl Default for PreallocationLimitOverride
impl Default for PreallocationLimitOverride
impl Eq for PreallocationLimitOverride
impl StructuralPartialEq for PreallocationLimitOverride
Auto Trait Implementations§
impl Freeze for PreallocationLimitOverride
impl RefUnwindSafe for PreallocationLimitOverride
impl Send for PreallocationLimitOverride
impl Sync for PreallocationLimitOverride
impl Unpin for PreallocationLimitOverride
impl UnsafeUnpin for PreallocationLimitOverride
impl UnwindSafe for PreallocationLimitOverride
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