Struct switchboard_solana::program_id::hash::Hash
pub struct Hash(/* private fields */);
Expand description
A hash; the 32-byte output of a hashing algorithm.
This struct is used most often in solana-sdk
and related crates to contain
a SHA-256 hash, but may instead contain a blake3 hash, as created by the
blake3
module (and used in Message::hash
).
Implementations§
Trait Implementations§
§impl BorshDeserialize for Hash
impl BorshDeserialize for Hash
fn deserialize_reader<__R>(reader: &mut __R) -> Result<Hash, Error>where
__R: Read,
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
§impl BorshSchema for Hash
impl BorshSchema for Hash
§fn declaration() -> String
fn declaration() -> String
Get the name of the type without brackets.
§fn add_definitions_recursively(definitions: &mut BTreeMap<String, Definition>)
fn add_definitions_recursively(definitions: &mut BTreeMap<String, Definition>)
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Hash, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Hash, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl FromWasmAbi for Hash
impl FromWasmAbi for Hash
§impl IntoWasmAbi for Hash
impl IntoWasmAbi for Hash
§impl LongRefFromWasmAbi for Hash
impl LongRefFromWasmAbi for Hash
§unsafe fn long_ref_from_abi(
js: <Hash as LongRefFromWasmAbi>::Abi
) -> <Hash as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <Hash as LongRefFromWasmAbi>::Abi ) -> <Hash as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
§impl OptionFromWasmAbi for Hash
impl OptionFromWasmAbi for Hash
§impl OptionIntoWasmAbi for Hash
impl OptionIntoWasmAbi for Hash
§impl Ord for Hash
impl Ord for Hash
§impl PartialOrd for Hash
impl PartialOrd for Hash
§fn partial_cmp(&self, other: &Hash) -> Option<Ordering>
fn partial_cmp(&self, other: &Hash) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl RefFromWasmAbi for Hash
impl RefFromWasmAbi for Hash
§type Anchor = Ref<'static, Hash>
type Anchor = Ref<'static, Hash>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.§unsafe fn ref_from_abi(
js: <Hash as RefFromWasmAbi>::Abi
) -> <Hash as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <Hash as RefFromWasmAbi>::Abi ) -> <Hash as RefFromWasmAbi>::Anchor
§impl RefMutFromWasmAbi for Hash
impl RefMutFromWasmAbi for Hash
§unsafe fn ref_mut_from_abi(
js: <Hash as RefMutFromWasmAbi>::Abi
) -> <Hash as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <Hash as RefMutFromWasmAbi>::Abi ) -> <Hash as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
§impl Serialize for Hash
impl Serialize for Hash
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFromJsValue for Hash
impl TryFromJsValue for Hash
§impl VectorFromWasmAbi for Hash
impl VectorFromWasmAbi for Hash
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: <Hash as VectorFromWasmAbi>::Abi) -> Box<[Hash]>
§impl VectorIntoWasmAbi for Hash
impl VectorIntoWasmAbi for Hash
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Hash]>) -> <Hash as VectorIntoWasmAbi>::Abi
impl Copy for Hash
impl Eq for Hash
impl Pod for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.