pub struct CountedWeave<W, K, N, T>{
pub weave: W,
pub count: WeaveActionCount,
/* private fields */
}Expand description
A Weave wrapper which logs the number of actions successfully performed on the inner Weave.
See WeaveActionCount for the complete list of loggable actions.
Fields§
§weave: WThe Weave being wrapped.
Actions performed directly on the inner Weave (without using the wrapper’s functions) are not logged.
count: WeaveActionCountThe number of actions that were performed on the attached Weave.
Implementations§
Source§impl<W, K, N, T> CountedWeave<W, K, N, T>
impl<W, K, N, T> CountedWeave<W, K, N, T>
Sourcepub const fn new(weave: W, count: WeaveActionCount) -> Self
pub const fn new(weave: W, count: WeaveActionCount) -> Self
Creates a CountedWeave from a Weave and WeaveActionCount pair.
Sourcepub fn from_weave(weave: W) -> Self
pub fn from_weave(weave: W) -> Self
Creates a CountedWeave from a Weave.
Sourcepub fn into_weave(self) -> W
pub fn into_weave(self) -> W
Converts a CountedWeave into it’s inner Weave.
Sourcepub const fn as_count(&self) -> &WeaveActionCount
pub const fn as_count(&self) -> &WeaveActionCount
Returns a reference to the inner WeaveActionCount.
Sourcepub fn reset_count(&mut self)
pub fn reset_count(&mut self)
Resets the inner WeaveActionCount to zero.
Trait Implementations§
Source§impl<W, K, N, T> ActivePathWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> ActivePathWeave<K, N, T> for CountedWeave<W, K, N, T>
Source§type Active = <W as ActivePathWeave<K, N, T>>::Active
type Active = <W as ActivePathWeave<K, N, T>>::Active
Identifiers of active nodes.
Source§fn set_active_path(&mut self, active: impl Iterator<Item = K>)
fn set_active_path(&mut self, active: impl Iterator<Item = K>)
Replaces the currently active path with the specified set of node IDs. Read more
Source§impl<W, K, N, T> ActiveSingularWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> ActiveSingularWeave<K, N, T> for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> Archive for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + Archive,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
WeaveActionCount: Archive,
PhantomData<K>: Archive,
PhantomData<N>: Archive,
PhantomData<T>: Archive,
impl<W, K, N, T> Archive for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + Archive,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
WeaveActionCount: Archive,
PhantomData<K>: Archive,
PhantomData<N>: Archive,
PhantomData<T>: Archive,
Source§type Archived = ArchivedCountedWeave<W, K, N, T>
type Archived = ArchivedCountedWeave<W, K, N, T>
The archived representation of this type. Read more
Source§type Resolver = CountedWeaveResolver<W, K, N, T>
type Resolver = CountedWeaveResolver<W, K, N, T>
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Creates the archived version of this value at the given position and
writes it to the given output. Read more
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§impl<W, K, N, T> AsRef<W> for CountedWeave<W, K, N, T>
impl<W, K, N, T> AsRef<W> for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> BookmarkableWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> BookmarkableWeave<K, N, T> for CountedWeave<W, K, N, T>
Source§type Bookmarks = <W as BookmarkableWeave<K, N, T>>::Bookmarks
type Bookmarks = <W as BookmarkableWeave<K, N, T>>::Bookmarks
Identifiers of bookmarked nodes.
Source§fn bookmarks(&self) -> &Self::Bookmarks
fn bookmarks(&self) -> &Self::Bookmarks
Returns a reference to the identifiers of bookmarked nodes.
Source§fn contains_bookmark(&self, id: &K) -> bool
fn contains_bookmark(&self, id: &K) -> bool
Returns
true if the Weave contains a bookmarked node with the specified identifier.Source§impl<W, K, N, T: Clone> Clone for CountedWeave<W, K, N, T>
impl<W, K, N, T: Clone> Clone for CountedWeave<W, K, N, T>
Source§fn clone(&self) -> CountedWeave<W, K, N, T>
fn clone(&self) -> CountedWeave<W, K, N, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<W, K, N, T: Copy> Copy for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T: Debug> Debug for CountedWeave<W, K, N, T>
impl<W, K, N, T: Debug> Debug for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> DeduplicatableWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: DeduplicatableWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: DeduplicatableContents,
impl<W, K, N, T> DeduplicatableWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: DeduplicatableWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: DeduplicatableContents,
Source§fn find_duplicates(&self, id: &K) -> impl Iterator<Item = K>
fn find_duplicates(&self, id: &K) -> impl Iterator<Item = K>
An iterator over the specified node’s sibling identifiers which contain contents which are duplicates of the specified node’s contents.
Source§impl<W, K, N, T: Default> Default for CountedWeave<W, K, N, T>
impl<W, K, N, T: Default> Default for CountedWeave<W, K, N, T>
Source§fn default() -> CountedWeave<W, K, N, T>
fn default() -> CountedWeave<W, K, N, T>
Returns the “default value” for a type. Read more
Source§impl<__D: Fallible + ?Sized, W, K, N, T> Deserialize<CountedWeave<W, K, N, T>, __D> for Archived<CountedWeave<W, K, N, T>>where
W: Weave<K, N, T> + Archive,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
<W as Archive>::Archived: Deserialize<W, __D>,
WeaveActionCount: Archive,
<WeaveActionCount as Archive>::Archived: Deserialize<WeaveActionCount, __D>,
PhantomData<K>: Archive,
<PhantomData<K> as Archive>::Archived: Deserialize<PhantomData<K>, __D>,
PhantomData<N>: Archive,
<PhantomData<N> as Archive>::Archived: Deserialize<PhantomData<N>, __D>,
PhantomData<T>: Archive,
<PhantomData<T> as Archive>::Archived: Deserialize<PhantomData<T>, __D>,
impl<__D: Fallible + ?Sized, W, K, N, T> Deserialize<CountedWeave<W, K, N, T>, __D> for Archived<CountedWeave<W, K, N, T>>where
W: Weave<K, N, T> + Archive,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
<W as Archive>::Archived: Deserialize<W, __D>,
WeaveActionCount: Archive,
<WeaveActionCount as Archive>::Archived: Deserialize<WeaveActionCount, __D>,
PhantomData<K>: Archive,
<PhantomData<K> as Archive>::Archived: Deserialize<PhantomData<K>, __D>,
PhantomData<N>: Archive,
<PhantomData<N> as Archive>::Archived: Deserialize<PhantomData<N>, __D>,
PhantomData<T>: Archive,
<PhantomData<T> as Archive>::Archived: Deserialize<PhantomData<T>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<CountedWeave<W, K, N, T>, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<CountedWeave<W, K, N, T>, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl<W, K, N, T> DiscreteWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> DiscreteWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T: Eq> Eq for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> From<W> for CountedWeave<W, K, N, T>
impl<W, K, N, T> From<W> for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T: Hash> Hash for CountedWeave<W, K, N, T>
impl<W, K, N, T: Hash> Hash for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> IndependentWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: IndependentWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: IndependentContents,
impl<W, K, N, T> IndependentWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: IndependentWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: IndependentContents,
Source§impl<W, K, N, T, M> MetadataWeave<K, N, T, M> for CountedWeave<W, K, N, T>
impl<W, K, N, T, M> MetadataWeave<K, N, T, M> for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T: Ord> Ord for CountedWeave<W, K, N, T>
impl<W, K, N, T: Ord> Ord for CountedWeave<W, K, N, T>
Source§fn cmp(&self, other: &CountedWeave<W, K, N, T>) -> Ordering
fn cmp(&self, other: &CountedWeave<W, K, N, T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<W, K, N, T: PartialEq> PartialEq for CountedWeave<W, K, N, T>
impl<W, K, N, T: PartialEq> PartialEq for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T: PartialOrd> PartialOrd for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + PartialOrd,
K: Hash + Copy + Eq + Ord + PartialOrd,
N: Node<K, T> + PartialOrd,
impl<W, K, N, T: PartialOrd> PartialOrd for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + PartialOrd,
K: Hash + Copy + Eq + Ord + PartialOrd,
N: Node<K, T> + PartialOrd,
Source§impl<W, K, N, T> SemiIndependentWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: SemiIndependentWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: IndependentContents,
impl<W, K, N, T> SemiIndependentWeave<K, N, T> for CountedWeave<W, K, N, T>where
W: SemiIndependentWeave<K, N, T>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
T: IndependentContents,
Source§impl<__S: Fallible + ?Sized, W, K, N, T> Serialize<__S> for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + Serialize<__S>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
WeaveActionCount: Serialize<__S>,
PhantomData<K>: Serialize<__S>,
PhantomData<N>: Serialize<__S>,
PhantomData<T>: Serialize<__S>,
impl<__S: Fallible + ?Sized, W, K, N, T> Serialize<__S> for CountedWeave<W, K, N, T>where
W: Weave<K, N, T> + Serialize<__S>,
K: Hash + Copy + Eq + Ord,
N: Node<K, T>,
WeaveActionCount: Serialize<__S>,
PhantomData<K>: Serialize<__S>,
PhantomData<N>: Serialize<__S>,
PhantomData<T>: Serialize<__S>,
Source§impl<W, K, N, T> SortableBookmarkableWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> SortableBookmarkableWeave<K, N, T> for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> SortableWeave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> SortableWeave<K, N, T> for CountedWeave<W, K, N, T>
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>)
Builds a list of all node identifiers ordered by their positions in the Weave. Read more
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>, )
Recursively builds a list of all children of the specified node ordered by their positions in the Weave. Read more
Source§fn sort_node_children_by(
&mut self,
id: &K,
cmp: impl FnMut(&N, &N) -> Ordering,
) -> bool
fn sort_node_children_by( &mut self, id: &K, cmp: impl FnMut(&N, &N) -> Ordering, ) -> bool
Sorts the child nodes of a parent node with the specified identifier using the comparison function
cmp. Read moreSource§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
Sorts the identifiers of a parent node’s children with the specified identifier using the comparison function
cmp. Read moreimpl<W, K, N, T: PartialEq> StructuralPartialEq for CountedWeave<W, K, N, T>
Source§impl<W, K, N, T> Weave<K, N, T> for CountedWeave<W, K, N, T>
impl<W, K, N, T> Weave<K, N, T> for CountedWeave<W, K, N, T>
Source§type Roots = <W as Weave<K, N, T>>::Roots
type Roots = <W as Weave<K, N, T>>::Roots
Identifiers of root nodes (nodes which do not have any parents).
Source§fn 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).
Source§fn contains(&self, id: &K) -> bool
fn contains(&self, id: &K) -> bool
Returns
true if the Weave contains a node with the specified identifier.Source§fn 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. Read moreSource§fn 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.
Source§fn get_ordered_node_identifiers(&mut self, output: &mut Vec<K>)
fn get_ordered_node_identifiers(&mut self, output: &mut Vec<K>)
Builds a list of all node identifiers ordered by their positions in the Weave.
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>)
Recursively builds a list of all children of the specified node ordered by their positions in the Weave.
Source§fn get_active_path(&mut self, output: &mut Vec<K>)
fn get_active_path(&mut self, output: &mut Vec<K>)
Builds a path through the Weave starting at the deepest active node and ending at a root node. Read more
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>)
Builds a path through the Weave starting at the specified node and ending at a root node. Read more
Source§fn add_node(&mut self, node: N) -> bool
fn add_node(&mut self, node: N) -> bool
Inserts a node into the Weave, returning
true if the insertion was successful. Read moreSource§fn set_node_active_status(&mut self, id: &K, value: bool) -> bool
fn set_node_active_status(&mut self, id: &K, value: bool) -> bool
Sets the active status of a node with the specified identifier. Read more
Source§fn remove_node(&mut self, id: &K) -> Option<N>
fn remove_node(&mut self, id: &K) -> Option<N>
Removes a node with the specified identifier, returning its value if it was present within the Weave. Read more
Source§fn remove_node_tracked(&mut self, id: &K, on_removal: impl FnMut(N)) -> bool
fn remove_node_tracked(&mut self, id: &K, on_removal: impl FnMut(N)) -> bool
Removes a node with the specified identifier, returning
true if it was present within the Weave. Read moreSource§fn remove_all_nodes(&mut self)
fn remove_all_nodes(&mut self)
Removes all nodes from the Weave.
Auto Trait Implementations§
impl<W, K, N, T> Freeze for CountedWeave<W, K, N, T>where
W: Freeze,
impl<W, K, N, T> RefUnwindSafe for CountedWeave<W, K, N, T>
impl<W, K, N, T> Send for CountedWeave<W, K, N, T>
impl<W, K, N, T> Sync for CountedWeave<W, K, N, T>
impl<W, K, N, T> Unpin for CountedWeave<W, K, N, T>
impl<W, K, N, T> UnsafeUnpin for CountedWeave<W, K, N, T>where
W: UnsafeUnpin,
impl<W, K, N, T> UnwindSafe for CountedWeave<W, K, N, T>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
The archived counterpart of this type. Unlike
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
Creates the archived version of the metadata for this value.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
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>
Returns the layout of the type.
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
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.