#[repr(transparent)]pub struct PathBuf(_);
Expand description
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
sourceimpl PathBuf
impl PathBuf
sourcepub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
B: AsRef<[u8]>,
pub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
B: AsRef<[u8]>,
Parse a path from its bytestring serialization.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new PathBuf
representing the root derivation path.
This is also the default value for PathBuf
.
sourcepub fn extend<'a, I, C>(&mut self, components: I) where
I: IntoIterator<Item = C>,
C: AsRef<Component<'a>>,
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.
Methods from Deref<Target = Path>
sourcepub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Obtain a reference to this path’s bytestring serialization.
sourcepub fn components(&self) -> Components<'_>ⓘNotable traits for Components<'a>impl<'a> Iterator for Components<'a> type Item = Component<'a>;
pub fn components(&self) -> Components<'_>ⓘNotable traits for Components<'a>impl<'a> Iterator for Components<'a> type Item = Component<'a>;
Obtain a component iterator for this path.
sourcepub fn join<P>(&self, path: P) -> PathBuf where
P: AsRef<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.
Trait Implementations
sourceimpl FromStr for PathBuf
impl FromStr for PathBuf
sourcefn from_str(s: &str) -> Result<Self, Error>
fn from_str(s: &str) -> Result<Self, Error>
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//
)
sourceimpl Ord for PathBuf
impl Ord for PathBuf
sourceimpl PartialOrd<PathBuf> for PathBuf
impl PartialOrd<PathBuf> for PathBuf
sourcefn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for PathBuf
impl StructuralEq for PathBuf
impl StructuralPartialEq for PathBuf
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more