Struct grafix_toolbox::lib::Memoized
source · pub struct Memoized<T, A> { /* private fields */ }Implementations§
source§impl<T, A: P + C> Memoized<T, A>
impl<T, A: P + C> Memoized<T, A>
pub fn new(func: fn(_: &A) -> T, a: impl Into<A>) -> Self
pub fn apply(&self, a: impl MemoizedArgs<A>) -> (bool, &T)
pub fn get_mut(&mut self) -> &mut T
pub fn get_args(&self) -> &A
pub fn get(&self) -> &T
pub fn take(&self) -> T
pub fn reset(&self)
pub fn finalize_deserialization(self, func: fn(_: &A) -> T) -> Self
Trait Implementations§
impl<T: Eq, A: P + C> Eq for Memoized<T, A>
Auto Trait Implementations§
impl<T, A> !Freeze for Memoized<T, A>
impl<T, A> !RefUnwindSafe for Memoized<T, A>
impl<T, A> Send for Memoized<T, A>
impl<T, A> !Sync for Memoized<T, A>
impl<T, A> Unpin for Memoized<T, A>
impl<T, A> UnwindSafe for Memoized<T, A>where
A: UnwindSafe,
T: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<A> MemoizedArgs<A> for A
impl<A> MemoizedArgs<A> for A
source§impl<T> OrAssignment for Twhere
T: Default,
impl<T> OrAssignment for Twhere
T: Default,
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.