Struct libqaul::Identity [−]
A generic object identifier
Implementations
impl Identity
pub fn truncate<'vec, V>(vec: V) -> Identity where
V: Into<&'vec Vec<u8, Global>>,
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>>,
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
pub fn clone(&self) -> Identity
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Identity
impl Debug for Identity
impl<'de> Deserialize<'de> for Identity
pub fn deserialize<D>(
deserializer: D
) -> Result<Identity, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
deserializer: D
) -> Result<Identity, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
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
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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?
pub fn into_iter(self) -> <Identity as IntoIterator>::IntoIter
impl Ord for Identity
pub fn cmp(&self, other: &Identity) -> Ordering
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Identity> for Identity
impl PartialOrd<Identity> for Identity
pub fn partial_cmp(&self, other: &Identity) -> Option<Ordering>
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Identity
pub fn serialize<S>(
&self,
ser: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
&self,
ser: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralEq for Identity
impl StructuralPartialEq for Identity
Auto Trait Implementations
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,