[−][src]Enum zeros::Zeros
Zeros
Features
-
Can be converted from some common hash slices such as
[u8; 16]
,[u8; 64]
... -
Implemented
Display
, which prints hex string of the hash, in lower-case. -
Implemented
Eq
andHash
traits, so you can use it inHashSet
,HashMap
... -
Debug
implementation:{:#?}
prints bytes in hexadecimal format.{:?}
prints bytes in decimal format.
Hexadecimal format (in lower case)
Examples:
use zeros::Zeros; let zeros = Zeros::from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); assert_eq!(zeros.to_string(), "000102030405060708090a0b0c0d0e0f");
Variants
Z128(Z128)
Z224(Z224)
Z256(Z256)
Z384(Z384)
Z512(Z512)
Methods
impl Zeros
[src]
pub const fn new_128() -> Self
[src]
pub const fn new_224() -> Self
[src]
pub const fn new_256() -> Self
[src]
pub const fn new_384() -> Self
[src]
pub const fn new_512() -> Self
[src]
pub fn len(&self) -> usize
[src]
pub fn same_class(&self, other: &Self) -> bool
[src]
Checks if this instance is same class as one other
Examples
use zeros::Zeros; assert!(Zeros::from([0; 16]).same_class(&Zeros::from([0; 32])) == false); assert!(Zeros::from([6; 48]).same_class(&Zeros::from([9; 48])));
pub const fn read_only(self) -> ReadOnlyZeros
[src]
Trait Implementations
impl Clone for Zeros
[src]
fn clone(&self) -> Zeros
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Zeros> for Zeros
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<Zeros> for ReadOnlyZeros
[src]
fn eq(&self, other: &Zeros) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<ReadOnlyZeros> for Zeros
[src]
fn eq(&self, other: &ReadOnlyZeros) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Zeros
[src]
impl AsRef<[u8]> for Zeros
[src]
impl From<[u8; 16]> for Zeros
[src]
impl From<[u8; 28]> for Zeros
[src]
impl From<[u8; 32]> for Zeros
[src]
impl From<[u8; 48]> for Zeros
[src]
impl From<[u8; 64]> for Zeros
[src]
impl<'_> From<&'_ Zeros> for Vec<u8>
[src]
impl From<Zeros> for Vec<u8>
[src]
impl<'_> From<&'_ Zeros> for String
[src]
Converts a &Zeros
into a hexadecimal string, in lower-case
Examples
use zeros::Zeros; assert_eq!( String::from(Zeros::from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])), "000102030405060708090a0b0c0d0e0f", );
impl From<Zeros> for String
[src]
Converts a Zeros
into a hexadecimal string, in lower-case
impl AsMut<[u8]> for Zeros
[src]
impl Debug for Zeros
[src]
impl Display for Zeros
[src]
impl TryFrom<Zeros> for Z128
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(zeros: Zeros) -> Result<Self, Self::Error>
[src]
impl TryFrom<Zeros> for Z224
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(zeros: Zeros) -> Result<Self, Self::Error>
[src]
impl TryFrom<Zeros> for Z256
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(zeros: Zeros) -> Result<Self, Self::Error>
[src]
impl TryFrom<Zeros> for Z384
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(zeros: Zeros) -> Result<Self, Self::Error>
[src]
impl TryFrom<Zeros> for Z512
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(zeros: Zeros) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ [u8]> for Zeros
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>
[src]
impl Hash for Zeros
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,