Struct depends::core::NodeState

source ·
pub struct NodeState<T, N = DependeeNodeState> { /* private fields */ }
Expand description

A wrapper for some data T, tracking some context around the data’s computation state.

Implementations§

source§

impl<T, N> NodeState<T, N>where T: HashValue,

source

pub fn node_hash(&self) -> NodeHash

source

pub fn node_hash_mut(&mut self) -> &mut NodeHash

source

pub fn update_node_hash(&mut self, hasher: &mut impl Hasher)

Update the stored hash value of the data.

source§

impl<T> NodeState<T, LeafNodeState>where T: UpdateLeaf,

source

pub fn new_leaf(data: T) -> NodeState<T, LeafNodeState>

source

pub fn state(&self) -> LeafState

source

pub fn state_mut(&mut self) -> &mut LeafState

Trait Implementations§

source§

impl<T, N> Clean for NodeState<T, N>where T: Clean,

source§

fn clean(&mut self)

source§

impl<T, N> Deref for NodeState<T, N>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<NodeState<T, N> as Deref>::Target

Dereferences the value.
source§

impl<T, N> DerefMut for NodeState<T, N>

source§

fn deref_mut(&mut self) -> &mut <NodeState<T, N> as Deref>::Target

Mutably dereferences the value.
source§

impl<T, N> HashValue for NodeState<T, N>where T: HashValue,

source§

fn hash_value(&self, _: &mut impl Hasher) -> NodeHash

Either a unique number, or a value detailing that this node cannot be hashed.
source§

impl<T, N> Named for NodeState<T, N>where T: Named,

source§

fn name() -> &'static str

source§

impl<T> UpdateLeaf for NodeState<T, LeafNodeState>where T: UpdateLeaf,

§

type Input = <T as UpdateLeaf>::Input

source§

fn update_mut( &mut self, input: <NodeState<T, LeafNodeState> as UpdateLeaf>::Input )

Auto Trait Implementations§

§

impl<T, N> RefUnwindSafe for NodeState<T, N>where N: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, N> Send for NodeState<T, N>where N: Send, T: Send,

§

impl<T, N> Sync for NodeState<T, N>where N: Sync, T: Sync,

§

impl<T, N> Unpin for NodeState<T, N>where N: Unpin, T: Unpin,

§

impl<T, N> UnwindSafe for NodeState<T, N>where N: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.