Struct libqaul::Identity[]

pub struct Identity(_);

A generic object identifier

Implementations

impl Identity

pub fn truncate<'vec, V>(vec: V) -> Identity where
    V: Into<&'vec Vec<u8, Global>>, 

Create an identity from the first 16 bytes of a vector

This function will panic, if the provided vector isn’t long enough, but extra data will simply be discarded.

pub fn from_bytes(buf: &[u8]) -> Identity

Create an identity from an exactly length-matched byte slice

This function will panic, if the provided slice isn’t exactly the length of the underlying identity implementation (see ID_LEN)

pub fn from_string(s: &String) -> Identity

pub fn as_bytes(&self) -> &[u8]

pub fn with_digest<'vec, V>(vec: V) -> Identity where
    V: Into<&'vec Vec<u8, Global>>, 

Create an identity using a digest function

This allows you to pass arbitrary length data which will result in a precise ID length data output. The hash function is the cryptographic blake2 cipher, so it can be used to turn secrets into identity information.

This function requires the digest feature.

pub fn random() -> Identity

Generate a new random Identity

pub fn iter(&'a self) -> impl Iterator<Item = &'a u8>

Returns an iterator over the bytes of the identity

Trait Implementations

impl AsRef<[u8]> for Identity

Implement RAW identity to binary array reference

impl Clone for Identity

impl Copy for Identity

impl Debug for Identity

impl<'de> Deserialize<'de> for Identity

impl Display for Identity

impl Eq for Identity

impl<'_> From<&'_ [u8; 32]> for Identity

Implement RAW From binary (reference) array

impl From<[u8; 32]> for Identity

Implement RAW From binary array

impl From<Identity> for Mode[src]

impl Hash for Identity

impl IntoIterator for Identity

type Item = u8

The type of the elements being iterated over.

type IntoIter = Iter

Which kind of iterator are we turning this into?

impl Ord for Identity

impl PartialEq<Identity> for Identity

impl PartialOrd<Identity> for Identity

impl Serialize for Identity

impl StructuralEq for Identity

impl StructuralPartialEq for Identity

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> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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> 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>, 

impl<T> WithSubscriber for T[src]