[−][src]Struct zeros::ReadOnlyZeros
Read-only zeros
This struct is simply a read-only wrapper of Zeros
.
- If you need a constant, you can make this struct directly from its constructor.
- Or you can use
Zeros::read_only()
.
Examples
use std::convert::TryFrom; use zeros::{ReadOnlyZeros, Zeros}; const SOME_HASH: ReadOnlyZeros = ReadOnlyZeros(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, another_hash.read_only());
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])));
Trait Implementations
impl Eq for ReadOnlyZeros
[src]
impl Clone for ReadOnlyZeros
[src]
fn clone(&self) -> ReadOnlyZeros
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<ReadOnlyZeros> for ReadOnlyZeros
[src]
fn eq(&self, other: &ReadOnlyZeros) -> bool
[src]
fn ne(&self, other: &ReadOnlyZeros) -> bool
[src]
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]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis 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]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl Display for ReadOnlyZeros
[src]
impl Deref for ReadOnlyZeros
[src]
impl Debug for ReadOnlyZeros
[src]
impl Hash for ReadOnlyZeros
[src]
Auto Trait Implementations
impl Send for ReadOnlyZeros
impl Sync for ReadOnlyZeros
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,