pub struct NixQueryTree(pub Tree<NixQueryEntry>);
Expand description
A Tree
representing the result from nix store --query --tree
.
use indoc::indoc;
use nix_query_tree_viewer::nix_query_tree::NixQueryTree;
use std::str::FromStr;
let raw_tree = indoc!(
"/nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10
+---/nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27
| +---/nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27 [...]
+---/nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10 [...]
"
);
let nix_query_tree = NixQueryTree::from_str(raw_tree);
assert!(nix_query_tree.is_ok());
Tuple Fields§
§0: Tree<NixQueryEntry>
Implementations§
Source§impl NixQueryTree
impl NixQueryTree
pub fn path_map(&self) -> NixQueryPathMap
pub fn lookup(&self, path: Path) -> Option<&NixQueryEntry>
Trait Implementations§
Source§impl Clone for NixQueryTree
impl Clone for NixQueryTree
Source§fn clone(&self) -> NixQueryTree
fn clone(&self) -> NixQueryTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NixQueryTree
impl Debug for NixQueryTree
Source§impl FromStr for NixQueryTree
impl FromStr for NixQueryTree
Source§impl PartialEq for NixQueryTree
impl PartialEq for NixQueryTree
impl Eq for NixQueryTree
impl StructuralPartialEq for NixQueryTree
Auto Trait Implementations§
impl Freeze for NixQueryTree
impl RefUnwindSafe for NixQueryTree
impl Send for NixQueryTree
impl Sync for NixQueryTree
impl Unpin for NixQueryTree
impl UnwindSafe for NixQueryTree
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