[−][src]Struct nix_query_tree_viewer::tree::Tree
Fields
item: T
children: Vec<Tree<T>>
Methods
impl<T> Tree<T>
[src]
pub fn new(item: T, children: Vec<Tree<T>>) -> Tree<T>
[src]
pub fn singleton(item: T) -> Tree<T>
[src]
pub fn lookup(&self, path: Path) -> Option<&T>
[src]
Lookup the item in the Tree
that corresponds to the given Path
.
pub fn path_map_map<U>(&self, f: &dyn Fn(&T) -> U) -> TreePathMap<U> where
U: Eq + Hash,
[src]
U: Eq + Hash,
Similar to path_map
, but take a function for mapping an item in the tree to an
alternative type to use to construct the TreePathMap
.
This is useful when there is some information in the item for the Tree
that
can be thrown away when constructing the TreePathMap
.
impl<T> Tree<T> where
T: Clone + Eq + Hash,
[src]
T: Clone + Eq + Hash,
pub fn path_map(&self) -> TreePathMap<T>
[src]
Create a TreePathMap
for the elements in the Tree
.
Trait Implementations
impl<T: Clone> Clone for Tree<T>
[src]
impl<T: Debug> Debug for Tree<T>
[src]
impl<T: Eq> Eq for Tree<T>
[src]
impl<T: PartialEq> PartialEq<Tree<T>> for Tree<T>
[src]
impl<T> StructuralEq for Tree<T>
[src]
impl<T> StructuralPartialEq for Tree<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Tree<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Tree<T> where
T: Send,
T: Send,
impl<T> Sync for Tree<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Tree<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Tree<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,