#[repr(transparent)]pub struct Hash(_);
Expand description
The primitive hash that among other things is used to reference items, types, and native functions.
Implementations§
source§impl Hash
impl Hash
sourcepub fn type_hash<I>(path: I) -> Selfwhere
I: IntoTypeHash,
pub fn type_hash<I>(path: I) -> Selfwhere I: IntoTypeHash,
Get the hash of a type.
sourcepub fn from_type_id(type_id: TypeId) -> Self
pub fn from_type_id(type_id: TypeId) -> Self
Construct a hash from a type id.
sourcepub fn instance_function<N>(type_hash: Hash, name: N) -> Selfwhere
N: InstFnName,
pub fn instance_function<N>(type_hash: Hash, name: N) -> Selfwhere N: InstFnName,
Construct a hash to an instance function, where the instance is a pre-determined type.
sourcepub fn field_fn<N>(protocol: Protocol, type_hash: Hash, name: N) -> Selfwhere
N: InstFnName,
pub fn field_fn<N>(protocol: Protocol, type_hash: Hash, name: N) -> Selfwhere N: InstFnName,
Construct a hash corresponding to a field function.
sourcepub fn index_fn(protocol: Protocol, type_hash: Hash, index: Hash) -> Self
pub fn index_fn(protocol: Protocol, type_hash: Hash, index: Hash) -> Self
Construct an index function.
sourcepub fn static_bytes(bytes: &[u8]) -> Hash
pub fn static_bytes(bytes: &[u8]) -> Hash
Get the hash corresponding to a static byte array.
sourcepub fn instance_fn_name(name: &str) -> Hash
pub fn instance_fn_name(name: &str) -> Hash
Get the hash corresponding to a instance function name.
sourcepub fn object_keys<I>(keys: I) -> Selfwhere
I: IntoIterator,
I::Item: AsRef<str>,
pub fn object_keys<I>(keys: I) -> Selfwhere I: IntoIterator, I::Item: AsRef<str>,
Hash the given iterator of object keys.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
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 InstFnName for Hash
impl InstFnName for Hash
source§impl IntoTypeHash for Hash
impl IntoTypeHash for Hash
source§impl Ord for Hash
impl Ord for Hash
source§impl PartialEq<Hash> for Hash
impl PartialEq<Hash> for Hash
source§impl PartialOrd<Hash> for Hash
impl PartialOrd<Hash> for Hash
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 moreimpl Copy for Hash
impl Eq for Hash
impl StructuralEq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
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