[][src]Struct hkd32::Component

#[repr(transparent)]
pub struct Component<'a>(_);

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]

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]

type Error = Infallible

The type returned in the event of a conversion error.

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

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.

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> Same<T> for T

type Output = T

Should always be Self