#[repr(transparent)]pub struct HashBytes(pub [u8; 32]);Expand description
Type alias for a cell hash.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl HashBytes
impl HashBytes
Sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
Sourcepub const fn wrap(value: &[u8; 32]) -> &Self
pub const fn wrap(value: &[u8; 32]) -> &Self
Wraps a reference to an internal array into a newtype reference.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns a mutable slice containing the entire array.
Sourcepub fn as_mut_array(&mut self) -> &mut [u8; 32]
pub fn as_mut_array(&mut self) -> &mut [u8; 32]
Returns a mutable internal array.
Sourcepub const fn first_chunk(&self) -> &[u8; 8]
pub const fn first_chunk(&self) -> &[u8; 8]
Returns a first chunk of 8 bytes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HashBytes
impl<'de> Deserialize<'de> for HashBytes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<GenericArray<u8, <CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>> as OutputSizeUser>::OutputSize>> for HashBytes
impl From<GenericArray<u8, <CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>> as OutputSizeUser>::OutputSize>> for HashBytes
Source§impl FromPlainAbi for HashBytes
impl FromPlainAbi for HashBytes
Source§fn from_plain_abi(value: PlainAbiValue) -> Result<Self>
fn from_plain_abi(value: PlainAbiValue) -> Result<Self>
Constructs self from the plain ABI value.
Source§impl IntoPlainAbi for HashBytes
impl IntoPlainAbi for HashBytes
Source§fn as_plain_abi(&self) -> PlainAbiValue
fn as_plain_abi(&self) -> PlainAbiValue
Returns a corresponding plain ABI value. Read more
Source§fn into_plain_abi(self) -> PlainAbiValuewhere
Self: Sized,
fn into_plain_abi(self) -> PlainAbiValuewhere
Self: Sized,
Converts into a corresponding plain ABI value.
Source§impl LoadDictKey for HashBytes
impl LoadDictKey for HashBytes
Source§fn load_from_data(b: &CellDataBuilder) -> Option<Self>
fn load_from_data(b: &CellDataBuilder) -> Option<Self>
Creates a key from a raw builder data.
Source§impl Ord for HashBytes
impl Ord for HashBytes
Source§impl PartialOrd for HashBytes
impl PartialOrd for HashBytes
Source§impl Store for HashBytes
impl Store for HashBytes
Source§fn store_into(
&self,
b: &mut CellBuilder,
_: &dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, b: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>
Tries to store itself into the cell builder.
Source§impl StoreDictKey for HashBytes
impl StoreDictKey for HashBytes
Source§fn store_into_data(&self, b: &mut CellDataBuilder) -> Result<(), Error>
fn store_into_data(&self, b: &mut CellDataBuilder) -> Result<(), Error>
Stores key bits into a builder data.
Source§impl WithAbiType for HashBytes
impl WithAbiType for HashBytes
Source§impl WithPlainAbiType for HashBytes
impl WithPlainAbiType for HashBytes
Source§fn plain_abi_type() -> PlainAbiType
fn plain_abi_type() -> PlainAbiType
Returns a corresponding plain ABI type.
impl Copy for HashBytes
impl Eq for HashBytes
impl StructuralPartialEq for HashBytes
Auto Trait Implementations§
impl Freeze for HashBytes
impl RefUnwindSafe for HashBytes
impl Send for HashBytes
impl Sync for HashBytes
impl Unpin for HashBytes
impl UnwindSafe for HashBytes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self to key and returns true if they are equal.Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)