Struct hdk::hash_path::path::Component[][src]

#[repr(transparent)]pub struct Component(_);

Each path component is arbitrary bytes to be hashed together in a predictable way when the path is hashed to create something that can be linked and discovered by all DHT participants.

Trait Implementations

impl AsRef<[u8]> for Component[src]

Access bytes.

impl Clone for Component[src]

impl Debug for Component[src]

impl Default for Component[src]

impl<'de> Deserialize<'de> for Component[src]

impl From<&'_ String> for Component[src]

Alias From<&str>

impl From<&'_ str> for Component[src]

Build a component from a String.

For many simple use cases we can construct a path out of a string similar to a URI. We represent this using the utf32 bytes rather than the utf8 bytes for the chars in the string which gives us a fixed width encoding for strings, which gives us a clean/easy way to support sharding based on strings by iterating over u32s rather than deciding what to do with variable width u8 or u16 characters.

impl From<Component> for Vec<u8>[src]

Unwrap bytes.

impl From<String> for Component[src]

Alias From<&str>

impl From<Vec<u8, Global>> for Component[src]

Wrap bytes.

impl PartialEq<Component> for Component[src]

impl Serialize for Component[src]

impl StructuralPartialEq for Component[src]

impl TryFrom<&'_ Component> for String[src]

Restoring a String from a Component requires Vec<u8> to u32 to utf8 handling.

type Error = SerializedBytesError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,