[−][src]Struct hkd32::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
).
Implementations
impl PathBuf
[src]
pub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
B: AsRef<[u8]>,
[src]
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>>,
[src]
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.
pub fn components(&self) -> Components<'_>ⓘNotable traits for Components<'a>
impl<'a> Iterator for Components<'a> type Item = Component<'a>;
[src]
Notable traits for Components<'a>
impl<'a> Iterator for Components<'a> type Item = Component<'a>;
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>,
[src]
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 AsRef<Path> for PathBuf
[src]
impl Borrow<Path> for PathBuf
[src]
impl Clone for PathBuf
[src]
impl Debug for PathBuf
[src]
impl Default for PathBuf
[src]
impl Deref for PathBuf
[src]
impl Drop for PathBuf
[src]
impl Eq 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 Hash for PathBuf
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for PathBuf
[src]
fn cmp(&self, other: &PathBuf) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PathBuf> for PathBuf
[src]
impl PartialOrd<PathBuf> for PathBuf
[src]
fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]
fn lt(&self, other: &PathBuf) -> bool
[src]
fn le(&self, other: &PathBuf) -> bool
[src]
fn gt(&self, other: &PathBuf) -> bool
[src]
fn ge(&self, other: &PathBuf) -> bool
[src]
impl StructuralEq for PathBuf
[src]
impl StructuralPartialEq for PathBuf
[src]
impl Zeroize for PathBuf
[src]
Auto Trait Implementations
impl RefUnwindSafe for PathBuf
impl Send for PathBuf
impl Sync for PathBuf
impl Unpin for PathBuf
impl UnwindSafe for PathBuf
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> Same<T> for T
type Output = T
Should always be Self
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Z> Zeroize for Z where
Z: DefaultIsZeroes,
[src]
Z: DefaultIsZeroes,