pub struct CompactAlphaMemory { /* private fields */ }Expand description
Compact Alpha Memory Uses HashSet to eliminate duplicates and reduce memory
Implementations§
Source§impl CompactAlphaMemory
impl CompactAlphaMemory
pub fn new() -> Self
Sourcepub fn add(&mut self, fact: &TypedFacts)
pub fn add(&mut self, fact: &TypedFacts)
Add fact to memory
Sourcepub fn remove(&mut self, fact: &TypedFacts) -> bool
pub fn remove(&mut self, fact: &TypedFacts) -> bool
Remove fact from memory
Sourcepub fn contains(&self, fact: &TypedFacts) -> bool
pub fn contains(&self, fact: &TypedFacts) -> bool
Check if fact exists
Sourcepub fn total_refs(&self) -> usize
pub fn total_refs(&self) -> usize
Get total references (including duplicates)
Sourcepub fn memory_savings(&self) -> f64
pub fn memory_savings(&self) -> f64
Get memory savings
Trait Implementations§
Source§impl Clone for CompactAlphaMemory
impl Clone for CompactAlphaMemory
Source§fn clone(&self) -> CompactAlphaMemory
fn clone(&self) -> CompactAlphaMemory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompactAlphaMemory
impl Debug for CompactAlphaMemory
Auto Trait Implementations§
impl Freeze for CompactAlphaMemory
impl RefUnwindSafe for CompactAlphaMemory
impl Send for CompactAlphaMemory
impl Sync for CompactAlphaMemory
impl Unpin for CompactAlphaMemory
impl UnwindSafe for CompactAlphaMemory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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