pub trait ImmutableWeave<K, N, T>{
type Nodes;
type Roots;
// Required methods
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn nodes(&self) -> &Self::Nodes;
fn roots(&self) -> &Self::Roots;
fn contains(&self, id: &K) -> bool;
fn contains_active(&self, id: &K) -> bool;
fn get_node(&self, id: &K) -> Option<&N>;
fn get_ordered_node_identifiers(&self, output: &mut Vec<K>);
fn get_ordered_node_identifiers_from(&self, id: &K, output: &mut Vec<K>);
fn get_active_path(&self, output: &mut Vec<K>);
fn get_path_from(&self, id: &K, output: &mut Vec<K>);
}Expand description
A read-only Weave.
Required Associated Types§
Required Methods§
Sourcefn roots(&self) -> &Self::Roots
fn roots(&self) -> &Self::Roots
Returns a reference to the identifiers of “root” nodes (nodes which do not have any parents).
Sourcefn contains(&self, id: &K) -> bool
fn contains(&self, id: &K) -> bool
Returns true if the Weave contains a node with the specified identifier.
Sourcefn contains_active(&self, id: &K) -> bool
fn contains_active(&self, id: &K) -> bool
Returns true if the Weave contains an “active” node (node.is_active() == true) with the specified identifier.
The meaning of this value can depend on the underlying Weave implementation.
Sourcefn get_node(&self, id: &K) -> Option<&N>
fn get_node(&self, id: &K) -> Option<&N>
Returns a reference to the node corresponding to the identifier.
Sourcefn get_ordered_node_identifiers(&self, output: &mut Vec<K>)
fn get_ordered_node_identifiers(&self, output: &mut Vec<K>)
Builds a list of all node identifiers ordered by their positions in the Weave.
Sourcefn get_ordered_node_identifiers_from(&self, id: &K, output: &mut Vec<K>)
fn get_ordered_node_identifiers_from(&self, id: &K, output: &mut Vec<K>)
Recursively builds a list of all children of the specified node ordered by their positions in the Weave.
Sourcefn get_active_path(&self, output: &mut Vec<K>)
fn get_active_path(&self, output: &mut Vec<K>)
Builds the longest contiguous path of active nodes which ends at a root node.
Sourcefn get_path_from(&self, id: &K, output: &mut Vec<K>)
fn get_path_from(&self, id: &K, output: &mut Vec<K>)
Builds a path through the Weave starting at the specified node and ending at a root node.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<K, T, M, S> ImmutableWeave<<K as Archive>::Archived, ArchivedDependentNode<K, T, S>, <T as Archive>::Archived> for ArchivedDependentWeave<K, T, M, S>
Available on crate feature rkyv only.
impl<K, T, M, S> ImmutableWeave<<K as Archive>::Archived, ArchivedDependentNode<K, T, S>, <T as Archive>::Archived> for ArchivedDependentWeave<K, T, M, S>
rkyv only.type Nodes = ArchivedHashMap<<K as Archive>::Archived, ArchivedDependentNode<K, T, S>>
type Roots = ArchivedIndexSet<<K as Archive>::Archived>
Source§impl<K, T, M, S> ImmutableWeave<<K as Archive>::Archived, ArchivedIndependentNode<K, T, S>, <T as Archive>::Archived> for ArchivedIndependentWeave<K, T, M, S>
Available on crate feature rkyv only.
impl<K, T, M, S> ImmutableWeave<<K as Archive>::Archived, ArchivedIndependentNode<K, T, S>, <T as Archive>::Archived> for ArchivedIndependentWeave<K, T, M, S>
rkyv only.