[−][src]Struct ratman_identity::Identity
A Ratman network identity
Note: this type implements Eq
, which is a much better way of
comparing two instances of Identity information than making a
string comparison. While this might be convenient in certain API
settings, we can't make the promise that the Display
implementation will never change.
Methods
impl Identity
[src]
pub fn truncate<'vec, V: Into<&'vec Vec<u8>>>(vec: V) -> Self
[src]
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 with_digest<'vec, V: Into<&'vec Vec<u8>>>(vec: V) -> Self
[src]
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.
Trait Implementations
impl AsRef<[u8]> for Identity
[src]
Implement RAW identity to binary array reference
impl Clone for Identity
[src]
impl Copy for Identity
[src]
impl Debug for Identity
[src]
impl<'de> Deserialize<'de> for Identity
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Identity
[src]
impl Eq for Identity
[src]
impl<'_> From<&'_ [u8; 16]> for Identity
[src]
Implement RAW From
binary (reference) array
impl<'_> From<&'_ Identity> for [u8; 16]
[src]
Implement binary array From
RAW reference
impl From<[u8; 16]> for Identity
[src]
Implement RAW From
binary array
impl From<Identity> for [u8; 16]
[src]
Implement binary array From
RAW
impl Hash for Identity
[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 Ord for Identity
[src]
fn cmp(&self, other: &Identity) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Identity> for Identity
[src]
impl PartialOrd<Identity> for Identity
[src]
fn partial_cmp(&self, other: &Identity) -> Option<Ordering>
[src]
fn lt(&self, other: &Identity) -> bool
[src]
fn le(&self, other: &Identity) -> bool
[src]
fn gt(&self, other: &Identity) -> bool
[src]
fn ge(&self, other: &Identity) -> bool
[src]
impl Serialize for Identity
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Identity
[src]
impl StructuralPartialEq for Identity
[src]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[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]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
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.
fn to_owned(&self) -> T
[src]
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.
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>,