pub struct RepoPathTree<V> { /* private fields */ }Expand description
Tree that maps RepoPath to value of type V.
Implementations§
Source§impl<V> RepoPathTree<V>
impl<V> RepoPathTree<V>
Sourcepub fn value_mut(&mut self) -> &mut V
pub fn value_mut(&mut self) -> &mut V
Mutable reference to the value associated with this path.
Sourcepub fn children(
&self,
) -> impl Iterator<Item = (&RepoPathComponent, &RepoPathTree<V>)>
pub fn children( &self, ) -> impl Iterator<Item = (&RepoPathComponent, &RepoPathTree<V>)>
The immediate children of this node.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Whether this node has any children.
Sourcepub fn add(&mut self, path: &RepoPath) -> &mut RepoPathTree<V>where
V: Default,
pub fn add(&mut self, path: &RepoPath) -> &mut RepoPathTree<V>where
V: Default,
Add a path to the tree. Normally called on the root tree.
Sourcepub fn get(&self, path: &RepoPath) -> Option<&RepoPathTree<V>>
pub fn get(&self, path: &RepoPath) -> Option<&RepoPathTree<V>>
Get a reference to the node for the given path, if it exists in the
tree.
Trait Implementations§
Source§impl<V> Clone for RepoPathTree<V>where
V: Clone,
impl<V> Clone for RepoPathTree<V>where
V: Clone,
Source§fn clone(&self) -> RepoPathTree<V>
fn clone(&self) -> RepoPathTree<V>
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 moreSource§impl<V> Debug for RepoPathTree<V>where
V: Debug,
impl<V> Debug for RepoPathTree<V>where
V: Debug,
Source§impl<V> Default for RepoPathTree<V>where
V: Default,
impl<V> Default for RepoPathTree<V>where
V: Default,
Source§fn default() -> RepoPathTree<V>
fn default() -> RepoPathTree<V>
Returns the “default value” for a type. Read more
impl<V> Eq for RepoPathTree<V>where
V: Eq,
Source§impl<V> PartialEq for RepoPathTree<V>where
V: PartialEq,
impl<V> PartialEq for RepoPathTree<V>where
V: PartialEq,
impl<V> StructuralPartialEq for RepoPathTree<V>where
V: PartialEq,
Auto Trait Implementations§
impl<V> Freeze for RepoPathTree<V>
impl<V> RefUnwindSafe for RepoPathTree<V>
impl<V> Send for RepoPathTree<V>
impl<V> Sync for RepoPathTree<V>
impl<V> Unpin for RepoPathTree<V>
impl<V> UnsafeUnpin for RepoPathTree<V>
impl<V> UnwindSafe for RepoPathTree<V>
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more