[][src]Struct hkd32::PathBuf

pub struct PathBuf(_);

Key derivation paths: location within a key hierarchy which names/identifies a specific key.

This is the owned path type. The corresponding reference type is hkd32::Path (ala the corresponding types in std).


impl PathBuf[src]

pub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
    B: AsRef<[u8]>, 

Parse a path from its bytestring serialization.

pub fn new() -> Self[src]

Create a new PathBuf representing the root derivation path.

This is also the default value for PathBuf.

pub fn as_path(&self) -> &Path[src]

Borrow this PathBuf as a Path

pub fn extend<'a, I, C>(&mut self, components: I) where
    I: IntoIterator<Item = C>,
    C: AsRef<Component<'a>>, 

Extend this key derivation path with additional components.

pub fn push<'a, C: AsRef<Component<'a>>>(&mut self, component: C)[src]

Push an additional component onto this path.

Methods from Deref<Target = Path>

pub fn as_bytes(&self) -> &[u8][src]

Obtain a reference to this path's bytestring serialization.

Important traits for Components<'a>
pub fn components(&self) -> Components[src]

Obtain a component iterator for this path.

pub fn is_root(&self) -> bool[src]

Is this path the root path?

pub fn join<P>(&self, path: P) -> PathBuf where
    P: AsRef<Path>, 

Create a PathBuf with path joined to self.

Requires the alloc feature is enabled.

pub fn parent(&self) -> Option<&Path>[src]

Get the parent path for this path

pub fn stringify(&self) -> Result<String, Error>[src]

Attempt to convert this path to an /x/y/z string.

This will only succeed if the path components are all ASCII.

Requires the alloc feature is enabled.

pub fn to_vec(&self) -> Vec<u8>[src]

Serialize this Path as a byte vector

Trait Implementations

impl Debug for PathBuf[src]

impl PartialEq<PathBuf> for PathBuf[src]

impl Eq for PathBuf[src]

impl Ord for PathBuf[src]

impl PartialOrd<PathBuf> for PathBuf[src]

impl FromStr for PathBuf[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Error>[src]

Parse a derivation path from a string.

Derivation path strings look like Unix paths (e.g. "/foo/bar/baz"). They are delimited by a slash character (/ a.k.a. hkd32::DELIMITER) and must start with a leading slash.

Empty path components are not allowed (e.g. //, /foo//)

impl Deref for PathBuf[src]

type Target = Path

The resulting type after dereferencing.

impl Drop for PathBuf[src]

impl Hash for PathBuf[src]

impl AsRef<Path> for PathBuf[src]

impl Clone for PathBuf[src]

impl Default for PathBuf[src]

impl Borrow<Path> for PathBuf[src]

impl Zeroize for PathBuf[src]

Auto Trait Implementations

impl Unpin for PathBuf

impl Send for PathBuf

impl Sync for PathBuf

impl UnwindSafe for PathBuf

impl RefUnwindSafe for PathBuf

Blanket Implementations

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<Z> Zeroize for Z where
    Z: DefaultIsZeroes