pub struct HardCappedRetainPolicy { /* private fields */ }Expand description
The only built-in policy: retain objects until explicit teardown, while refusing allocations beyond a fixed hard cap.
Implementations§
Source§impl HardCappedRetainPolicy
impl HardCappedRetainPolicy
Sourcepub fn new(max_objects: usize) -> Result<Self, ArenaError>
pub fn new(max_objects: usize) -> Result<Self, ArenaError>
Creates a retain policy with a non-zero object cap.
Sourcepub const fn max_objects(self) -> usize
pub const fn max_objects(self) -> usize
Returns the allocation cap.
Trait Implementations§
Source§impl Clone for HardCappedRetainPolicy
impl Clone for HardCappedRetainPolicy
Source§fn clone(&self) -> HardCappedRetainPolicy
fn clone(&self) -> HardCappedRetainPolicy
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 HardCappedRetainPolicy
Source§impl Debug for HardCappedRetainPolicy
impl Debug for HardCappedRetainPolicy
impl Eq for HardCappedRetainPolicy
Source§impl PartialEq for HardCappedRetainPolicy
impl PartialEq for HardCappedRetainPolicy
impl StructuralPartialEq for HardCappedRetainPolicy
Auto Trait Implementations§
impl Freeze for HardCappedRetainPolicy
impl RefUnwindSafe for HardCappedRetainPolicy
impl Send for HardCappedRetainPolicy
impl Sync for HardCappedRetainPolicy
impl Unpin for HardCappedRetainPolicy
impl UnsafeUnpin for HardCappedRetainPolicy
impl UnwindSafe for HardCappedRetainPolicy
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