Struct calc_graph::Const
source · pub struct Const<T>(_);
Expand description
Calculates a node’s value by returning the same value every time.
Trait Implementations
sourceimpl<T: Clone> Calc for Const<T>
impl<T: Clone> Calc for Const<T>
type Value = T
type Value = T
The type of values calculated by the node.
sourcefn add_dep(&mut self, _seen: &mut BitSet, _dep: NonZeroUsize)
fn add_dep(&mut self, _seen: &mut BitSet, _dep: NonZeroUsize)
When this node is used as a precedent,
add_dep
is called by dependent nodes when they are created. Read moresourcefn eval(&mut self, _dirty: &mut BitSet) -> (NonZeroUsize, T)
fn eval(&mut self, _dirty: &mut BitSet) -> (NonZeroUsize, T)
Returns the value held within the node and the version number of the inputs used to calcuate that value.
The value is recalculated if needed. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Const<T>where
T: RefUnwindSafe,
impl<T> Send for Const<T>where
T: Send,
impl<T> Sync for Const<T>where
T: Sync,
impl<T> Unpin for Const<T>where
T: Unpin,
impl<T> UnwindSafe for Const<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more