pub struct HardCappedRetainPolicy { /* private fields */ }Expand description
Shared language-neutral arena, node, edge, and retention building blocks. 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<HardCappedRetainPolicy, ArenaError>
pub fn new(max_objects: usize) -> Result<HardCappedRetainPolicy, 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more