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ยง
Sourceยงimpl BorshDeserialize for Hash
impl BorshDeserialize for Hash
fn deserialize_reader<__R>(reader: &mut __R) -> Result<Hash, Error>where
__R: Read,
Sourceยง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.
Sourceยง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,
Sourceยงimpl BorshSchema for Hash
impl BorshSchema for Hash
Sourceยงfn declaration() -> String
fn declaration() -> String
Get the name of the type without brackets.
Sourceยง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.
Sourceยงimpl BorshSerialize for Hash
impl BorshSerialize for Hash
Sourceยงimpl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Sourceยง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
Sourceยงimpl From<Hash> for MessageHash
impl From<Hash> for MessageHash
Sourceยงfn from(hash: Hash) -> MessageHash
fn from(hash: Hash) -> MessageHash
Converts to this type from the input type.
Sourceยงimpl FromWasmAbi for Hash
impl FromWasmAbi for Hash
Sourceยงimpl IntoWasmAbi for Hash
impl IntoWasmAbi for Hash
Sourceยงimpl LongRefFromWasmAbi for Hash
impl LongRefFromWasmAbi for Hash
Sourceยงimpl OptionFromWasmAbi for Hash
impl OptionFromWasmAbi for Hash
Sourceยงimpl OptionIntoWasmAbi for Hash
impl OptionIntoWasmAbi for Hash
Sourceยงimpl Ord for Hash
impl Ord for Hash
Sourceยงimpl PartialOrd for Hash
impl PartialOrd for Hash
Sourceยงimpl RefFromWasmAbi for Hash
impl RefFromWasmAbi for Hash
Sourceยงtype Anchor = RcRef<Hash>
type Anchor = RcRef<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.Sourceยง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
Sourceยงimpl RefMutFromWasmAbi for Hash
impl RefMutFromWasmAbi for Hash
Sourceยงimpl Serialize for Hash
impl Serialize for Hash
Sourceยง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
Sourceยงimpl TryFromJsValue for Hash
impl TryFromJsValue for Hash
Sourceยง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]>
Sourceยง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> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Sourceยงimpl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Sourceยง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.Sourceยง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.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ยง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
Compare self to
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
Compare self to
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<CustErr, T, Request> FromReq<Cbor, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<Cbor, Request, CustErr> for T
Sourceยงasync fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Sourceยงimpl<CustErr, T, Request> FromReq<GetUrl, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<GetUrl, Request, CustErr> for T
Sourceยงasync fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Sourceยงimpl<CustErr, T, Request> FromReq<Json, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<Json, Request, CustErr> for T
Sourceยงasync fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Sourceยงimpl<CustErr, T, Request> FromReq<PostUrl, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<PostUrl, Request, CustErr> for T
Sourceยงasync fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Sourceยงimpl<CustErr, T, Response> FromRes<Cbor, Response, CustErr> for T
impl<CustErr, T, Response> FromRes<Cbor, Response, CustErr> for T
Sourceยงasync fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the outputs from a response.
Sourceยงimpl<CustErr, T, Response> FromRes<Json, Response, CustErr> for T
impl<CustErr, T, Response> FromRes<Json, Response, CustErr> for T
Sourceยงasync fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the outputs from a response.
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Sourceยงimpl<CustErr, T, Response> IntoRes<Cbor, Response, CustErr> for T
impl<CustErr, T, Response> IntoRes<Cbor, Response, CustErr> for T
Sourceยงasync fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
Attempts to serialize the output into an HTTP response.
Sourceยงimpl<CustErr, T, Response> IntoRes<Json, Response, CustErr> for T
impl<CustErr, T, Response> IntoRes<Json, Response, CustErr> for T
Sourceยงasync fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
Attempts to serialize the output into an HTTP response.
Sourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Sourceยงtype Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSourceยง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.Sourceยงimpl<T> Serializable for Twhere
T: DeserializeOwned + Serialize,
impl<T> Serializable for Twhere
T: DeserializeOwned + Serialize,
Sourceยงimpl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Sourceยงfn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Sourceยงimpl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Sourceยงfn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.