[−][src]Struct zeros::ReadOnlyZeros
Read-only zeros
This struct is simply a read-only wrapper of Zeros
.
Examples
use std::convert::TryFrom; use zeros::{ReadOnlyZeros, Zeros}; const SOME_HASH: ReadOnlyZeros = ReadOnlyZeros::new(Zeros::Z128([ 0xb2, 0xc2, 0x5d, 0x4b, 0x26, 0xd9, 0xfc, 0xb0, 0xb3, 0x6f, 0xc9, 0xdf, 0x33, 0xb2, 0x8b, 0x46, ])); // Zeros implements AsRef<[u8]> and TryFrom<&[u8]> let another_hash = Zeros::try_from(SOME_HASH.as_ref())?; assert_eq!(SOME_HASH, another_hash); assert_eq!(SOME_HASH.to_string(), another_hash.to_string()); assert_eq!(SOME_HASH, ReadOnlyZeros::from(another_hash));
Methods
impl ReadOnlyZeros
[src]
Methods from Deref<Target = Zeros>
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 fn to_vec(&self) -> Vec<u8>
[src]
Trait Implementations
impl Clone for ReadOnlyZeros
[src]
fn clone(&self) -> ReadOnlyZeros
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ReadOnlyZeros
[src]
impl Deref for ReadOnlyZeros
[src]
impl Display for ReadOnlyZeros
[src]
impl Eq for ReadOnlyZeros
[src]
impl From<[u8; 16]> for ReadOnlyZeros
[src]
impl From<[u8; 28]> for ReadOnlyZeros
[src]
impl From<[u8; 32]> for ReadOnlyZeros
[src]
impl From<[u8; 48]> for ReadOnlyZeros
[src]
impl From<[u8; 64]> for ReadOnlyZeros
[src]
impl From<Zeros> for ReadOnlyZeros
[src]
impl Hash for ReadOnlyZeros
[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 PartialEq<ReadOnlyZeros> for ReadOnlyZeros
[src]
fn eq(&self, other: &ReadOnlyZeros) -> bool
[src]
fn ne(&self, other: &ReadOnlyZeros) -> bool
[src]
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]
impl PartialEq<Zeros> for ReadOnlyZeros
[src]
impl StructuralEq for ReadOnlyZeros
[src]
impl StructuralPartialEq for ReadOnlyZeros
[src]
impl<'_> TryFrom<&'_ [u8]> for ReadOnlyZeros
[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 TryFrom<Vec<u8>> for ReadOnlyZeros
[src]
Auto Trait Implementations
impl RefUnwindSafe for ReadOnlyZeros
impl Send for ReadOnlyZeros
impl Sync for ReadOnlyZeros
impl Unpin for ReadOnlyZeros
impl UnwindSafe for ReadOnlyZeros
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,