[−][src]Struct hkd32::Component
Component of a derivation path
Methods
impl<'a> Component<'a>
[src]
pub fn new(bytes: &'a [u8]) -> Result<Self, Error>
[src]
Create a new component.
Returns Error
if the component is empty or is longer than
MAX_COMPONENT_LENGTH
.
pub fn as_bytes(&self) -> &'a [u8]
[src]
Borrow the contents of this component as a byte slice.
pub fn len(&self) -> usize
[src]
Get the length of this component in bytes.
pub fn stringify(&self) -> Result<String, Error>
[src]
Attempt to convert component to an ASCII string.
Requires the alloc
feature is enabled.
pub fn to_bytes(&self) -> Vec<u8>
[src]
Serialize this component as a length-prefixed bytestring.
Trait Implementations
impl<'a> Debug for Component<'a>
[src]
impl<'a> PartialEq<Component<'a>> for Component<'a>
[src]
impl<'a> Eq for Component<'a>
[src]
impl<'a> Hash for Component<'a>
[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<'a> Copy for Component<'a>
[src]
impl<'a> AsRef<Component<'a>> for Component<'a>
[src]
impl<'a> Clone for Component<'a>
[src]
Auto Trait Implementations
impl<'a> Unpin for Component<'a>
impl<'a> Send for Component<'a>
impl<'a> Sync for Component<'a>
impl<'a> UnwindSafe for Component<'a>
impl<'a> RefUnwindSafe for Component<'a>
Blanket Implementations
impl<T> From<T> for 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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> Same<T> for T
type Output = T
Should always be Self