[][src]Struct nix_query_tree_viewer::nix_query_tree::NixQueryDrv

pub struct NixQueryDrv(_);

This corresponds to a nix store path.

use nix_query_tree_viewer::nix_query_tree::NixQueryDrv;

let nix_query_drv =
    NixQueryDrv::from("/nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10");

Methods

impl NixQueryDrv[src]

pub fn cmp_hash(&self, other: &Self) -> Ordering[src]

pub fn cmp_drv_name(&self, other: &Self) -> Ordering[src]

pub fn hash_and_drv_name(&self) -> String[src]

Pull out the hash and derivation name from a NixQueryDrv

use nix_query_tree_viewer::nix_query_tree::NixQueryDrv;

let nix_query_drv =
    NixQueryDrv::from("/nix/store/az4kl5slhbkmmy4vj98z3hzxxkan7zza-gnugrep-3.3");
assert_eq!(
    nix_query_drv.hash_and_drv_name(),
    String::from("az4kl5slhbkmmy4vj98z3hzxxkan7zza-gnugrep-3.3")
);

pub fn short_hash_and_drv_name(&self) -> String[src]

Pull out a truncated hash and derivation name from a NixQueryDrv

use nix_query_tree_viewer::nix_query_tree::NixQueryDrv;

let nix_query_drv =
    NixQueryDrv::from("/nix/store/az4kl5slhbkmmy4vj98z3hzxxkan7zza-gnugrep-3.3");
assert_eq!(
    nix_query_drv.short_hash_and_drv_name(),
    String::from("az4kl5s..gnugrep-3.3")
);

pub fn drv_name(&self) -> String[src]

Pull out a derivation name from a NixQueryDrv.

use nix_query_tree_viewer::nix_query_tree::NixQueryDrv;

let nix_query_drv =
    NixQueryDrv::from("/nix/store/az4kl5slhbkmmy4vj98z3hzxxkan7zza-gnugrep-3.3");
assert_eq!(nix_query_drv.drv_name(), String::from("gnugrep-3.3"));
  • Panics

This panics if the derivation name doesn't have a - in it. All nix derivations have a - in them after the hash.

Trait Implementations

impl Clone for NixQueryDrv[src]

impl Debug for NixQueryDrv[src]

impl Deref for NixQueryDrv[src]

type Target = Path

The resulting type after dereferencing.

impl Display for NixQueryDrv[src]

impl Eq for NixQueryDrv[src]

impl<'_, T: ?Sized + AsRef<OsStr>> From<&'_ T> for NixQueryDrv[src]

impl FromStr for NixQueryDrv[src]

type Err = ()

The associated error which can be returned from parsing.

impl Hash for NixQueryDrv[src]

impl PartialEq<NixQueryDrv> for NixQueryDrv[src]

impl StructuralEq for NixQueryDrv[src]

impl StructuralPartialEq for NixQueryDrv[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.