pub struct DependentNode<K, T, S>{
pub id: K,
pub from: Option<K>,
pub to: IndexSet<K, S>,
pub active: bool,
pub bookmarked: bool,
pub contents: T,
}Expand description
A Node in a DependentWeave document.
Fields§
§id: KThe node’s unique identifier.
from: Option<K>The identifier corresponding to the node’s parent.
to: IndexSet<K, S>The identifiers corresponding to the node’s children.
active: boolIf the node should be considered “active”.
DependentWeave only considers the node at the start of an active path to be “active”.
bookmarked: boolIf the node is bookmarked.
contents: TThe node’s contents.
Trait Implementations§
Source§impl<K, T, M, S> ActionableWeave<K, DependentNode<K, T, S>, T, M, S> for DependentWeave<K, T, M, S>where
K: Hash + Copy + Eq + Ord,
T: IndependentContents + DiscreteContents,
S: BuildHasher + Default + Clone,
impl<K, T, M, S> ActionableWeave<K, DependentNode<K, T, S>, T, M, S> for DependentWeave<K, T, M, S>where
K: Hash + Copy + Eq + Ord,
T: IndependentContents + DiscreteContents,
S: BuildHasher + Default + Clone,
Source§fn apply(&mut self, action: WeaveAction<K, DependentNode<K, T, S>, T, M>)
fn apply(&mut self, action: WeaveAction<K, DependentNode<K, T, S>, T, M>)
Source§impl<K, T, M, S> ActiveSingularWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> ActiveSingularWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§impl<K, T, S> Archive for DependentNode<K, T, S>
impl<K, T, S> Archive for DependentNode<K, T, S>
Source§type Archived = ArchivedDependentNode<K, T, S>
type Archived = ArchivedDependentNode<K, T, S>
Source§type Resolver = DependentNodeResolver<K, T, S>
type Resolver = DependentNodeResolver<K, T, S>
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl<K, T, M, S> BookmarkableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> BookmarkableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn set_node_bookmarked_status(&mut self, id: &K, value: bool) -> bool
fn set_node_bookmarked_status(&mut self, id: &K, value: bool) -> bool
§Contracts
Post-condition: ! ret || value == self.bookmarked.contains(id)
Post-condition: ret || old(self.bookmarked.clone()) == self.bookmarked
Post-condition: ret == self.nodes.contains_key(id)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Invariant: self.validate()
Source§fn bookmarks(&self) -> &Self::Bookmarks
fn bookmarks(&self) -> &Self::Bookmarks
Source§fn contains_bookmark(&self, id: &K) -> bool
fn contains_bookmark(&self, id: &K) -> bool
true if the Weave contains a bookmarked node with the specified identifier.Source§impl<K, T: Clone, S> Clone for DependentNode<K, T, S>
impl<K, T: Clone, S> Clone for DependentNode<K, T, S>
Source§fn clone(&self) -> DependentNode<K, T, S>
fn clone(&self) -> DependentNode<K, T, S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<K, T: Debug, S> Debug for DependentNode<K, T, S>
impl<K, T: Debug, S> Debug for DependentNode<K, T, S>
Source§impl<K, T, M, S> DeduplicatableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> DeduplicatableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn find_duplicates(&self, id: &K) -> impl Iterator<Item = K>
fn find_duplicates(&self, id: &K) -> impl Iterator<Item = K>
Source§impl<K, T: Default, S> Default for DependentNode<K, T, S>
impl<K, T: Default, S> Default for DependentNode<K, T, S>
Source§fn default() -> DependentNode<K, T, S>
fn default() -> DependentNode<K, T, S>
Source§impl<__D: Fallible + ?Sized, K, T, S> Deserialize<DependentNode<K, T, S>, __D> for Archived<DependentNode<K, T, S>>where
K: Hash + Copy + Eq + Ord + Archive,
S: BuildHasher + Default + Clone,
<K as Archive>::Archived: Deserialize<K, __D>,
Option<K>: Archive,
<Option<K> as Archive>::Archived: Deserialize<Option<K>, __D>,
IndexSet<K, S>: Archive,
<IndexSet<K, S> as Archive>::Archived: Deserialize<IndexSet<K, S>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
T: Archive,
<T as Archive>::Archived: Deserialize<T, __D>,
impl<__D: Fallible + ?Sized, K, T, S> Deserialize<DependentNode<K, T, S>, __D> for Archived<DependentNode<K, T, S>>where
K: Hash + Copy + Eq + Ord + Archive,
S: BuildHasher + Default + Clone,
<K as Archive>::Archived: Deserialize<K, __D>,
Option<K>: Archive,
<Option<K> as Archive>::Archived: Deserialize<Option<K>, __D>,
IndexSet<K, S>: Archive,
<IndexSet<K, S> as Archive>::Archived: Deserialize<IndexSet<K, S>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
T: Archive,
<T as Archive>::Archived: Deserialize<T, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<DependentNode<K, T, S>, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<DependentNode<K, T, S>, <__D as Fallible>::Error>
Source§impl<K, T, M, S> DiscreteWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> DiscreteWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn split_node(&mut self, id: &K, at: usize, new_id: K) -> bool
fn split_node(&mut self, id: &K, at: usize, new_id: K) -> bool
§Contracts
Post-condition: ! ret || old(self.nodes.len()) + 1 == self.nodes.len()
Post-condition: ! ret || self.nodes.contains_key(id)
Post-condition: ! ret || self.nodes.contains_key(&new_id)
Post-condition: ! ret || old(!self.nodes.contains_key(&new_id))
Post-condition: ! ret || self.nodes [id].to.contains(&new_id) && self.nodes [id].to.len() == 1
Post-condition: ! ret || self.nodes [&new_id].from == Some(*id)
Post-condition: ! ret || old(self.nodes.get(id).map(|n| n.to.clone())).unwrap() == self.nodes [&new_id].to
Post-condition: ret || old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn merge_with_parent(&mut self, id: &K) -> Option<K>
fn merge_with_parent(&mut self, id: &K) -> Option<K>
§Contracts
Post-condition: ret.is_none() || old(self.nodes.len()) - 1 == self.nodes.len()
Post-condition: ret.is_none() || ! self.nodes.contains_key(id)
Post-condition: ret.is_none() || old(self.nodes.contains_key(id))
Post-condition: ret.is_none() || ! old(self.contains_active(id)) || old(self.contains_active(id)) && self.contains_active(&ret.unwrap())
Post-condition: ret.is_none() || old(self.contains_active(id)) || old(self.nodes.get(id).and_then(|n| n.from).and_then(|p| self.nodes.get(&p)).map(|p| p.active)).unwrap() == self.nodes [&ret.unwrap()].active
Post-condition: ret.is_none() || old(self.nodes.get(id).and_then(|n| n.from).and_then(|p| self.nodes.get(&p)).map(|p| p.from)).unwrap() == self.nodes [&ret.unwrap()].from
Post-condition: ret.is_none() || old(self.nodes.get(id).map(|node| node.to.clone())).unwrap() == self.nodes [&ret.unwrap()].to
Post-condition: ret.is_none() || ret.unwrap() == old(self.nodes.get(id).and_then(|node| node.from)).unwrap()
Post-condition: ret.is_some() || old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: ret.is_some() || old(self.active) == self.active
Post-condition: ret.is_some() || old(self.bookmarked.clone()) == self.bookmarked
Post-condition: old(self.roots.clone()) == self.roots
Invariant: self.validate()
impl<K, T, S> Eq for DependentNode<K, T, S>
Source§impl<K, T, S> From<DependentNode<K, T, S>> for IndependentNode<K, T, S>
impl<K, T, S> From<DependentNode<K, T, S>> for IndependentNode<K, T, S>
Source§fn from(value: DependentNode<K, T, S>) -> Self
fn from(value: DependentNode<K, T, S>) -> Self
Source§impl<K, T, M, S> MetadataWeave<K, DependentNode<K, T, S>, T, M> for DependentWeave<K, T, M, S>
impl<K, T, M, S> MetadataWeave<K, DependentNode<K, T, S>, T, M> for DependentWeave<K, T, M, S>
Source§fn metadata_mut<O>(&mut self, callback: impl FnOnce(&mut M) -> O) -> O
fn metadata_mut<O>(&mut self, callback: impl FnOnce(&mut M) -> O) -> O
§Contracts
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§impl<K, T, S> Node<K, T> for DependentNode<K, T, S>
impl<K, T, S> Node<K, T> for DependentNode<K, T, S>
Source§impl<K, T, S> PartialEq for DependentNode<K, T, S>
impl<K, T, S> PartialEq for DependentNode<K, T, S>
Source§impl<K, T, M, S> SemiIndependentWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> SemiIndependentWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn get_contents_mut<O>(
&mut self,
id: &K,
callback: impl FnOnce(&mut T) -> O,
) -> Option<O>
fn get_contents_mut<O>( &mut self, id: &K, callback: impl FnOnce(&mut T) -> O, ) -> Option<O>
§Contracts
Post-condition: ret.is_some() == old(self.nodes.contains_key(id))
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§impl<K, T, M, S> SortableBookmarkableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> SortableBookmarkableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn sort_bookmarks_by(
&mut self,
cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering,
)
fn sort_bookmarks_by( &mut self, cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering, )
§Contracts
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn sort_bookmarks_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
fn sort_bookmarks_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
§Contracts
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§impl<K, T, M, S> SortableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> SortableWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn get_ordered_node_identifiers_mirrored(&mut self, output: &mut Vec<K>)
fn get_ordered_node_identifiers_mirrored(&mut self, output: &mut Vec<K>)
§Contracts
Post-condition: output.len() == self.nodes.len()
Post-condition: valid_topological_sort(&self.nodes, output)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn get_ordered_node_identifiers_mirrored_from(
&mut self,
id: &K,
output: &mut Vec<K>,
)
fn get_ordered_node_identifiers_mirrored_from( &mut self, id: &K, output: &mut Vec<K>, )
§Contracts
Post-condition: lacks_duplicates(output)
Post-condition: ! self.nodes.contains_key(id) || output.first() == Some(id)
Post-condition: self.nodes.contains_key(id) || output.is_empty()
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn sort_node_children_by(
&mut self,
id: &K,
cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering,
) -> bool
fn sort_node_children_by( &mut self, id: &K, cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering, ) -> bool
§Contracts
Post-condition: ret == self.nodes.contains_key(id)
Post-condition: old(self.nodes.get(id).map(|n| n.to.clone())) == self.nodes.get(id).map(|n| n.to.clone())
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn sort_node_children_by_id(
&mut self,
id: &K,
cmp: impl FnMut(&K, &K) -> Ordering,
) -> bool
fn sort_node_children_by_id( &mut self, id: &K, cmp: impl FnMut(&K, &K) -> Ordering, ) -> bool
§Contracts
Post-condition: ret == self.nodes.contains_key(id)
Post-condition: old(self.nodes.get(id).map(|n| n.to.clone())) == self.nodes.get(id).map(|n| n.to.clone())
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn sort_roots_by(
&mut self,
cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering,
)
fn sort_roots_by( &mut self, cmp: impl FnMut(&DependentNode<K, T, S>, &DependentNode<K, T, S>) -> Ordering, )
§Contracts
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn sort_roots_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
fn sort_roots_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
§Contracts
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§impl<K, T, S> TryFrom<IndependentNode<K, T, S>> for DependentNode<K, T, S>
impl<K, T, S> TryFrom<IndependentNode<K, T, S>> for DependentNode<K, T, S>
Source§type Error = IndependentNode<K, T, S>
type Error = IndependentNode<K, T, S>
Source§impl<K, T, M, S> Weave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
impl<K, T, M, S> Weave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
Source§fn get_ordered_node_identifiers(&mut self, output: &mut Vec<K>)
fn get_ordered_node_identifiers(&mut self, output: &mut Vec<K>)
§Contracts
Post-condition: output.len() == self.nodes.len()
Post-condition: valid_topological_sort(&self.nodes, output)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn get_ordered_node_identifiers_from(&mut self, id: &K, output: &mut Vec<K>)
fn get_ordered_node_identifiers_from(&mut self, id: &K, output: &mut Vec<K>)
§Contracts
Post-condition: lacks_duplicates(output)
Post-condition: ! self.nodes.contains_key(id) || output.first() == Some(id)
Post-condition: self.nodes.contains_key(id) || output.is_empty()
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn get_active_path(&mut self, output: &mut Vec<K>)
fn get_active_path(&mut self, output: &mut Vec<K>)
§Contracts
Post-condition: self.active == output.first().copied()
Post-condition: lacks_duplicates(output)
Post-condition: valid_path(&self.nodes, output)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn get_path_from(&mut self, id: &K, output: &mut Vec<K>)
fn get_path_from(&mut self, id: &K, output: &mut Vec<K>)
§Contracts
Post-condition: ! self.nodes.contains_key(id) || output.first() == Some(id)
Post-condition: self.nodes.contains_key(id) || output.is_empty()
Post-condition: lacks_duplicates(output)
Post-condition: valid_path(&self.nodes, output)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.active) == self.active
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn add_node(&mut self, node: DependentNode<K, T, S>) -> bool
fn add_node(&mut self, node: DependentNode<K, T, S>) -> bool
§Contracts
Post-condition: ! ret || old(self.nodes.len()) + 1 == self.nodes.len()
Post-condition: ! ret || old(!self.nodes.contains_key(&node.id))
Post-condition: ! ret || self.nodes.contains_key(&old(node.id))
Post-condition: ! ret || old(node.active) == (self.active == Some(old(node.id)))
Post-condition: ! ret || old(node.bookmarked) == self.bookmarked.contains(&old(node.id))
Post-condition: ! ret || old(node.from.is_some()) || self.roots.contains(&old(node.id))
Post-condition: ! ret || old(node.from.is_none()) || old(self.roots.clone()) == self.roots
Post-condition: ret || old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: ret || old(self.roots.clone()) == self.roots
Post-condition: ret || old(self.active) == self.active
Post-condition: ret || old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn set_node_active_status(&mut self, id: &K, value: bool) -> bool
fn set_node_active_status(&mut self, id: &K, value: bool) -> bool
§Contracts
Post-condition: ! ret || value == self.contains_active(id)
Post-condition: ret || old(self.active) == self.active
Post-condition: ret == self.nodes.contains_key(id)
Post-condition: old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: old(self.roots.clone()) == self.roots
Post-condition: old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn remove_node(&mut self, id: &K) -> Option<DependentNode<K, T, S>>
fn remove_node(&mut self, id: &K) -> Option<DependentNode<K, T, S>>
§Contracts
Post-condition: ! self.nodes.contains_key(id)
Post-condition: ret.is_some() == old(self.nodes.contains_key(id))
Post-condition: ret.as_ref().is_none_or(|node| &node.id == id)
Post-condition: ret.is_none() || old(self.nodes.len()) > self.nodes.len()
Post-condition: ret.is_none() || old(self.bookmarked.len()) >= self.bookmarked.len()
Post-condition: ret.is_some() || old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: ret.is_some() || old(self.roots.clone()) == self.roots
Post-condition: ret.is_some() || old(self.active) == self.active
Post-condition: ret.is_some() || old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn remove_node_tracked(
&mut self,
id: &K,
on_removal: impl FnMut(DependentNode<K, T, S>),
) -> bool
fn remove_node_tracked( &mut self, id: &K, on_removal: impl FnMut(DependentNode<K, T, S>), ) -> bool
§Contracts
Post-condition: ! self.nodes.contains_key(id)
Post-condition: ret == old(self.nodes.contains_key(id))
Post-condition: ! ret || old(self.nodes.len()) > self.nodes.len()
Post-condition: ! ret || old(self.bookmarked.len()) >= self.bookmarked.len()
Post-condition: ret || old(self.nodes.keys().copied().collect::<HashSet<_>>()) == self.nodes.keys().copied().collect ::< HashSet < _ >> ()
Post-condition: ret || old(self.roots.clone()) == self.roots
Post-condition: ret || old(self.active) == self.active
Post-condition: ret || old(self.bookmarked.clone()) == self.bookmarked
Invariant: self.validate()
Source§fn remove_all_nodes(&mut self)
fn remove_all_nodes(&mut self)
Source§type Nodes = HashMap<K, DependentNode<K, T, S>, S>
type Nodes = HashMap<K, DependentNode<K, T, S>, S>
Source§type Roots = IndexSet<K, S>
type Roots = IndexSet<K, S>
Source§fn roots(&self) -> &Self::Roots
fn roots(&self) -> &Self::Roots
Source§fn contains(&self, id: &K) -> bool
fn contains(&self, id: &K) -> bool
true if the Weave contains a node with the specified identifier.Auto Trait Implementations§
impl<K, T, S> Freeze for DependentNode<K, T, S>
impl<K, T, S> RefUnwindSafe for DependentNode<K, T, S>
impl<K, T, S> Send for DependentNode<K, T, S>
impl<K, T, S> Sync for DependentNode<K, T, S>
impl<K, T, S> Unpin for DependentNode<K, T, S>
impl<K, T, S> UnsafeUnpin for DependentNode<K, T, S>
impl<K, T, S> UnwindSafe for DependentNode<K, T, S>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.