#[repr(transparent)]pub struct Hash(_);Expand description
The primitive hash that among other things is used to reference items, types, and native functions.
Implementations
sourceimpl Hash
impl Hash
sourcepub fn type_hash<I>(path: I) -> Self where
I: IntoTypeHash,
pub fn type_hash<I>(path: I) -> Self where
I: IntoTypeHash,
Get the hash of a type.
sourcepub const fn from_type_id(type_id: TypeId) -> Self
pub const 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) -> Self where
N: InstFnName,
pub fn instance_function<N>(type_hash: Hash, name: N) -> Self where
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) -> Self where
N: InstFnName,
pub fn field_fn<N>(protocol: Protocol, type_hash: Hash, name: N) -> Self where
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 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) -> Self where
I: IntoIterator,
I::Item: AsRef<str>,
pub fn object_keys<I>(keys: I) -> Self where
I: IntoIterator,
I::Item: AsRef<str>,
Hash the given iterator of object keys.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
sourcefn 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
sourceimpl InstFnName for Hash
impl InstFnName for Hash
sourceimpl IntoTypeHash for Hash
impl IntoTypeHash for Hash
sourceimpl Ord for Hash
impl Ord for Hash
sourceimpl PartialOrd<Hash> for Hash
impl PartialOrd<Hash> for Hash
sourcefn partial_cmp(&self, other: &Hash) -> Option<Ordering>
fn partial_cmp(&self, other: &Hash) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more