Skip to main content

Node

Trait Node 

Source
pub trait Node<K, T>
where K: Hash + Copy + Eq + Ord,
{ type From; type To; // Required methods fn id(&self) -> K; fn from(&self) -> &Self::From; fn to(&self) -> &Self::To; fn is_active(&self) -> bool; fn contents(&self) -> &T; }
Expand description

An item within a Weave which can be connected to other items.

Required Associated Types§

Source

type From

Identifiers corresponding to the node’s parents.

Source

type To

Identifiers corresponding to the node’s children.

Required Methods§

Source

fn id(&self) -> K

Returns the node’s unique identifier.

Source

fn from(&self) -> &Self::From

Returns a reference to the identifiers corresponding to the node’s parents.

Source

fn to(&self) -> &Self::To

Returns a reference to the identifiers corresponding to the node’s children.

Source

fn is_active(&self) -> bool

Returns true if the node is considered active.

The meaning of this value can depend on the underlying Weave implementation.

Source

fn contents(&self) -> &T

Returns a reference to the node’s contents.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, T, S> Node<<K as Archive>::Archived, <T as Archive>::Archived> for ArchivedDependentNode<K, T, S>
where K: Archive + Hash + Copy + Eq + Ord, <K as Archive>::Archived: Hash + Copy + Eq + Ord + 'static, T: Archive, S: BuildHasher + Default + Clone,

Available on crate feature rkyv only.
Source§

impl<K, T, S> Node<<K as Archive>::Archived, <T as Archive>::Archived> for ArchivedIndependentNode<K, T, S>
where K: Archive + Hash + Copy + Eq + Ord, <K as Archive>::Archived: Hash + Copy + Eq + Ord + 'static, T: Archive + IndependentContents, S: BuildHasher + Default + Clone,

Available on crate feature rkyv only.
Source§

impl<K, T, S> Node<K, T> for DependentNode<K, T, S>
where K: Hash + Copy + Eq + Ord, S: BuildHasher + Default + Clone,

Source§

type From = Option<K>

Source§

type To = IndexSet<K, S>

Source§

impl<K, T, S> Node<K, T> for IndependentNode<K, T, S>

Source§

type From = IndexSet<K, S>

Source§

type To = IndexSet<K, S>