Type Alias holochain::prelude::HoloHashOf
source · pub type HoloHashOf<C> = HoloHash<<C as HashableContent>::HashType>;
Expand description
A convenience type, for specifying a hash by HashableContent rather than by its HashType
Aliased Type§
struct HoloHashOf<C> { /* private fields */ }
Implementations§
source§impl HoloHash<AnyLinkable>
impl HoloHash<AnyLinkable>
sourcepub fn into_primitive(self) -> AnyLinkableHashPrimitive
pub fn into_primitive(self) -> AnyLinkableHashPrimitive
Match on the primitive hash type represented by this composite hash type
sourcepub fn into_any_dht_hash(self) -> Option<HoloHash<AnyDht>>
pub fn into_any_dht_hash(self) -> Option<HoloHash<AnyDht>>
Downcast to AnyDhtHash if this is not an external hash
sourcepub fn into_action_hash(self) -> Option<HoloHash<Action>>
pub fn into_action_hash(self) -> Option<HoloHash<Action>>
If this hash represents an ActionHash, return it, else None
sourcepub fn into_entry_hash(self) -> Option<HoloHash<Entry>>
pub fn into_entry_hash(self) -> Option<HoloHash<Entry>>
If this hash represents an EntryHash, return it, else None
sourcepub fn into_agent_pub_key(self) -> Option<HoloHash<Agent>>
pub fn into_agent_pub_key(self) -> Option<HoloHash<Agent>>
If this hash represents an EntryHash which is actually an AgentPubKey, return it, else None.
sourcepub fn into_external_hash(self) -> Option<HoloHash<External>>
pub fn into_external_hash(self) -> Option<HoloHash<External>>
If this hash represents an ExternalHash, return it, else None
source§impl HoloHash<AnyDht>
impl HoloHash<AnyDht>
sourcepub fn into_primitive(self) -> AnyDhtHashPrimitive
pub fn into_primitive(self) -> AnyDhtHashPrimitive
Match on the primitive hash type represented by this composite hash type
sourcepub fn into_action_hash(self) -> Option<HoloHash<Action>>
pub fn into_action_hash(self) -> Option<HoloHash<Action>>
If this hash represents an ActionHash, return it, else None
sourcepub fn into_entry_hash(self) -> Option<HoloHash<Entry>>
pub fn into_entry_hash(self) -> Option<HoloHash<Entry>>
If this hash represents an EntryHash, return it, else None
sourcepub fn into_agent_pub_key(self) -> Option<HoloHash<Agent>>
pub fn into_agent_pub_key(self) -> Option<HoloHash<Agent>>
If this hash represents an EntryHash which is actually an AgentPubKey, return it, else None.
source§impl<T> HoloHash<T>where
T: HashType,
impl<T> HoloHash<T>where T: HashType,
sourcepub fn from_raw_39(hash: Vec<u8, Global>) -> Result<HoloHash<T>, HoloHashError>
pub fn from_raw_39(hash: Vec<u8, Global>) -> Result<HoloHash<T>, HoloHashError>
Raw constructor: Create a HoloHash from 39 bytes, using the prefix bytes to determine the hash_type
sourcepub fn from_raw_39_panicky(hash: Vec<u8, Global>) -> HoloHash<T>
pub fn from_raw_39_panicky(hash: Vec<u8, Global>) -> HoloHash<T>
Raw constructor: Create a HoloHash from 39 bytes, using the prefix bytes to determine the hash_type. Panics if hash_type does not match.
sourcepub fn from_raw_36_and_type(bytes: Vec<u8, Global>, hash_type: T) -> HoloHash<T>
pub fn from_raw_36_and_type(bytes: Vec<u8, Global>, hash_type: T) -> HoloHash<T>
Use a precomputed hash + location byte array in vec form, along with a type, to construct a hash. Used in this crate only, for testing.
sourcepub fn get_raw_39(&self) -> &[u8] ⓘ
pub fn get_raw_39(&self) -> &[u8] ⓘ
Get the raw 39-byte Vec including the 3 byte prefix, base 32 bytes, and the 4 byte loc
sourcepub fn get_raw_36(&self) -> &[u8] ⓘ
pub fn get_raw_36(&self) -> &[u8] ⓘ
Get 36-byte Vec which excludes the 3 byte prefix
sourcepub fn get_raw_32(&self) -> &[u8] ⓘ
pub fn get_raw_32(&self) -> &[u8] ⓘ
Fetch just the core 32 bytes (without the 4 location bytes)
sourcepub fn get_loc(&self) -> DhtLocation
pub fn get_loc(&self) -> DhtLocation
Fetch the holo dht location for this hash
source§impl<P> HoloHash<P>where
P: PrimitiveHashType,
impl<P> HoloHash<P>where P: PrimitiveHashType,
source§impl<T> HoloHash<T>where
T: HashTypeSync,
impl<T> HoloHash<T>where T: HashTypeSync,
sourcepub fn with_data_sync<C>(content: &C) -> HoloHash<T>where
C: HashableContent<HashType = T>,
pub fn with_data_sync<C>(content: &C) -> HoloHash<T>where C: HashableContent<HashType = T>,
Synchronously hash a reference to the given content to produce a HoloHash If the content is larger than MAX_HASHABLE_CONTENT_LEN, this will panic!
source§impl<T> HoloHash<T>where
T: HashTypeAsync,
impl<T> HoloHash<T>where T: HashTypeAsync,
Trait Implementations§
source§impl AgentPubKeyExt for HoloHash<Agent>
impl AgentPubKeyExt for HoloHash<Agent>
source§fn new_random(
keystore: &MetaLairClient
) -> MustBoxFuture<'static, Result<HoloHash<Agent>, OneErr>> ⓘwhere
HoloHash<Agent>: Sized,
fn new_random( keystore: &MetaLairClient ) -> MustBoxFuture<'static, Result<HoloHash<Agent>, OneErr>> ⓘwhere HoloHash<Agent>: Sized,
source§fn sign_raw(
&self,
keystore: &MetaLairClient,
data: Arc<[u8], Global>
) -> MustBoxFuture<'static, Result<Signature, OneErr>> ⓘ
fn sign_raw( &self, keystore: &MetaLairClient, data: Arc<[u8], Global> ) -> MustBoxFuture<'static, Result<Signature, OneErr>> ⓘ
source§fn verify_signature_raw(
&self,
signature: &Signature,
data: Arc<[u8], Global>
) -> MustBoxFuture<'static, Result<bool, KeystoreError>> ⓘ
fn verify_signature_raw( &self, signature: &Signature, data: Arc<[u8], Global> ) -> MustBoxFuture<'static, Result<bool, KeystoreError>> ⓘ
source§fn sign<S>(
&self,
keystore: &MetaLairClient,
input: S
) -> MustBoxFuture<'static, Result<Signature, OneErr>> ⓘwhere
S: Serialize + Debug,
fn sign<S>( &self, keystore: &MetaLairClient, input: S ) -> MustBoxFuture<'static, Result<Signature, OneErr>> ⓘwhere S: Serialize + Debug,
source§fn verify_signature<D>(
&self,
signature: &Signature,
data: D
) -> MustBoxFuture<'static, Result<bool, KeystoreError>> ⓘwhere
D: TryInto<SerializedBytes, Error = SerializedBytesError>,
fn verify_signature<D>( &self, signature: &Signature, data: D ) -> MustBoxFuture<'static, Result<bool, KeystoreError>> ⓘwhere D: TryInto<SerializedBytes, Error = SerializedBytesError>,
source§impl AgentPubKeyExt for HoloHash<Agent>
impl AgentPubKeyExt for HoloHash<Agent>
source§fn into_kitsune(self) -> Arc<KitsuneAgent, Global>
fn into_kitsune(self) -> Arc<KitsuneAgent, Global>
Arc<Kitsune>
typesource§fn into_kitsune_raw(self) -> KitsuneAgent
fn into_kitsune_raw(self) -> KitsuneAgent
source§fn from_kitsune(k: &Arc<KitsuneAgent, Global>) -> HoloHash<Agent>
fn from_kitsune(k: &Arc<KitsuneAgent, Global>) -> HoloHash<Agent>
source§fn from_kitsune_raw(k: KitsuneAgent) -> HoloHash<Agent>
fn from_kitsune_raw(k: KitsuneAgent) -> HoloHash<Agent>
source§fn to_kitsune(&self) -> Arc<KitsuneAgent, Global>
fn to_kitsune(&self) -> Arc<KitsuneAgent, Global>
Arc<Kitsune>
typesource§impl AnyDhtHashExt for HoloHash<AnyDht>
impl AnyDhtHashExt for HoloHash<AnyDht>
source§fn into_kitsune(self) -> Arc<KitsuneBasis, Global>
fn into_kitsune(self) -> Arc<KitsuneBasis, Global>
Arc<Kitsune>
typesource§fn into_kitsune_raw(self) -> KitsuneBasis
fn into_kitsune_raw(self) -> KitsuneBasis
source§fn to_kitsune(&self) -> Arc<KitsuneBasis, Global>
fn to_kitsune(&self) -> Arc<KitsuneBasis, Global>
Arc<Kitsune>
typesource§impl AnyLinkableHashExt for HoloHash<AnyLinkable>
impl AnyLinkableHashExt for HoloHash<AnyLinkable>
source§fn into_kitsune(self) -> Arc<KitsuneBasis, Global>
fn into_kitsune(self) -> Arc<KitsuneBasis, Global>
Arc<Kitsune>
typesource§fn into_kitsune_raw(self) -> KitsuneBasis
fn into_kitsune_raw(self) -> KitsuneBasis
source§fn to_kitsune(&self) -> Arc<KitsuneBasis, Global>
fn to_kitsune(&self) -> Arc<KitsuneBasis, Global>
Arc<Kitsune>
typesource§impl<'a> Arbitrary<'a> for HoloHash<AnyLinkable>
impl<'a> Arbitrary<'a> for HoloHash<AnyLinkable>
source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<AnyLinkable>, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<AnyLinkable>, Error>
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moresource§impl<'a, P> Arbitrary<'a> for HoloHash<P>where
P: PrimitiveHashType,
impl<'a, P> Arbitrary<'a> for HoloHash<P>where P: PrimitiveHashType,
source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<P>, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<P>, Error>
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moresource§impl<'de, T> Deserialize<'de> for HoloHash<T>where
T: HashType,
impl<'de, T> Deserialize<'de> for HoloHash<T>where T: HashType,
source§fn deserialize<D>(
deserializer: D
) -> Result<HoloHash<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<HoloHash<T>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl DhtOpHashExt for HoloHash<DhtOp>
impl DhtOpHashExt for HoloHash<DhtOp>
source§fn into_kitsune(self) -> Arc<KitsuneOpHash, Global>
fn into_kitsune(self) -> Arc<KitsuneOpHash, Global>
Arc<Kitsune>
typesource§fn into_kitsune_raw(self) -> KitsuneOpHash
fn into_kitsune_raw(self) -> KitsuneOpHash
source§fn from_kitsune(k: &Arc<KitsuneOpHash, Global>) -> HoloHash<DhtOp>
fn from_kitsune(k: &Arc<KitsuneOpHash, Global>) -> HoloHash<DhtOp>
source§fn from_kitsune_raw(k: KitsuneOpHash) -> HoloHash<DhtOp>
fn from_kitsune_raw(k: KitsuneOpHash) -> HoloHash<DhtOp>
source§fn to_kitsune(&self) -> Arc<KitsuneOpHash, Global>
fn to_kitsune(&self) -> Arc<KitsuneOpHash, Global>
Arc<Kitsune>
typesource§impl DnaHashExt for HoloHash<Dna>
impl DnaHashExt for HoloHash<Dna>
source§fn into_kitsune(self) -> Arc<KitsuneSpace, Global>
fn into_kitsune(self) -> Arc<KitsuneSpace, Global>
Arc<Kitsune>
typesource§fn into_kitsune_raw(self) -> KitsuneSpace
fn into_kitsune_raw(self) -> KitsuneSpace
source§fn from_kitsune(k: &Arc<KitsuneSpace, Global>) -> HoloHash<Dna>
fn from_kitsune(k: &Arc<KitsuneSpace, Global>) -> HoloHash<Dna>
source§fn from_kitsune_raw(k: KitsuneSpace) -> HoloHash<Dna>
fn from_kitsune_raw(k: KitsuneSpace) -> HoloHash<Dna>
source§fn to_kitsune(&self) -> Arc<KitsuneSpace, Global>
fn to_kitsune(&self) -> Arc<KitsuneSpace, Global>
Arc<Kitsune>
typesource§impl From<HoloHashB64<Action>> for HoloHash<AnyLinkable>
impl From<HoloHashB64<Action>> for HoloHash<AnyLinkable>
source§fn from(h: HoloHashB64<Action>) -> HoloHash<AnyLinkable>
fn from(h: HoloHashB64<Action>) -> HoloHash<AnyLinkable>
source§impl From<HoloHashB64<Entry>> for HoloHash<AnyLinkable>
impl From<HoloHashB64<Entry>> for HoloHash<AnyLinkable>
source§fn from(h: HoloHashB64<Entry>) -> HoloHash<AnyLinkable>
fn from(h: HoloHashB64<Entry>) -> HoloHash<AnyLinkable>
source§impl<T> From<HoloHashB64<T>> for HoloHash<T>where
T: HashType,
impl<T> From<HoloHashB64<T>> for HoloHash<T>where T: HashType,
source§fn from(original: HoloHashB64<T>) -> HoloHash<T>
fn from(original: HoloHashB64<T>) -> HoloHash<T>
source§impl<T> FromSql for HoloHash<T>where
T: HashType,
impl<T> FromSql for HoloHash<T>where T: HashType,
source§fn column_result(value: ValueRef<'_>) -> Result<HoloHash<T>, FromSqlError>
fn column_result(value: ValueRef<'_>) -> Result<HoloHash<T>, FromSqlError>
source§impl<T> IntoIterator for HoloHash<T>where
T: HashType,
impl<T> IntoIterator for HoloHash<T>where T: HashType,
source§impl<T> Ord for HoloHash<T>where
T: Ord + HashType,
impl<T> Ord for HoloHash<T>where T: Ord + HashType,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<T> PartialEq<HoloHash<T>> for HoloHash<T>where
T: PartialEq<T> + HashType,
impl<T> PartialEq<HoloHash<T>> for HoloHash<T>where T: PartialEq<T> + HashType,
source§impl<T> PartialOrd<HoloHash<T>> for HoloHash<T>where
T: PartialOrd<T> + HashType,
impl<T> PartialOrd<HoloHash<T>> for HoloHash<T>where T: PartialOrd<T> + HashType,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more