[−][src]Struct zeros::Zeros
Zeros
Features
- Can be converted from some common hash slices such as
[u8; 16],[u8; 64]... - Implemented
Debugvia#[derive(Debug)], so internal field(s) are printed similarly to usual way you work with Rust. - Implemented
Display, which prints hex string of the hash, in lower-case. - Implemented
EqandHashtraits, so you can use it inHashSet,HashMap...
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(), String::from(&zeros));
Methods
impl Zeros[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])));
Trait Implementations
impl PartialEq<Zeros> for Zeros[src]
impl AsRef<[u8]> for Zeros[src]
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 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]
Converts a Zeros into a vector of bytes (the original slice)
This implementation simply takes inner vector out. There is no copy/allocation.
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 Eq for Zeros[src]
impl Display for Zeros[src]
impl Debug for Zeros[src]
impl Hash for Zeros[src]
Auto Trait Implementations
Blanket Implementations
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> From<T> for T[src]
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,