[][src]Struct clarity_repl::clarity::util::hash::Sha256Sum

pub struct Sha256Sum(pub [u8; 32]);

Implementations

impl Sha256Sum[src]

pub fn as_ptr(&self) -> *const u8[src]

Converts the object to a raw pointer

pub fn as_mut_ptr(&mut self) -> *mut u8[src]

Converts the object to a mutable raw pointer

pub fn len(&self) -> usize[src]

Returns the length of the object as an array

pub fn is_empty(&self) -> bool[src]

Returns whether the object, as an array, is empty. Always false.

pub fn as_bytes(&self) -> &[u8; 32][src]

Returns the underlying bytes.

pub fn to_bytes(&self) -> [u8; 32][src]

Returns the underlying bytes.

pub fn into_bytes(self) -> [u8; 32][src]

Returns the underlying bytes.

impl Sha256Sum[src]

pub fn from_hex(hex_str: &str) -> Result<Sha256Sum, HexError>[src]

Instantiates from a hex string

pub fn from_bytes(inp: &[u8]) -> Option<Sha256Sum>[src]

Instantiates from a slice of bytes

pub fn from_bytes_be(inp: &[u8]) -> Option<Sha256Sum>[src]

Instantiates from a slice of bytes, converting to host byte order

pub fn from_vec(inp: &Vec<u8>) -> Option<Sha256Sum>[src]

Instantiates from a vector of bytes

pub fn from_vec_be(b: &Vec<u8>) -> Option<Sha256Sum>[src]

Instantiates from a big-endian vector of bytes, converting to host byte order

pub fn to_hex(&self) -> String[src]

Convert to a hex string

impl Sha256Sum[src]

pub fn from_data(data: &[u8]) -> Sha256Sum[src]

Trait Implementations

impl AsRef<[u8]> for Sha256Sum[src]

impl Clone for Sha256Sum[src]

impl Copy for Sha256Sum[src]

impl Debug for Sha256Sum[src]

impl Display for Sha256Sum[src]

impl Eq for Sha256Sum[src]

impl<'a> From<&'a [u8]> for Sha256Sum[src]

impl From<[u8; 32]> for Sha256Sum[src]

impl Hash for Sha256Sum[src]

impl Index<Range<usize>> for Sha256Sum[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFrom<usize>> for Sha256Sum[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for Sha256Sum[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for Sha256Sum[src]

type Output = [u8]

The returned type after indexing.

impl Index<usize> for Sha256Sum[src]

type Output = u8

The returned type after indexing.

impl Ord for Sha256Sum[src]

impl PartialEq<Sha256Sum> for Sha256Sum[src]

impl PartialOrd<Sha256Sum> for Sha256Sum[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.