Type Alias holochain::prelude::OpBasis

source ·
pub type OpBasis = HoloHash<AnyLinkable>;
Expand description

Alias for AnyLinkableHash. This hash forms the notion of the “basis hash” of an op.

Aliased Type§

struct OpBasis { /* private fields */ }

Implementations§

source§

impl HoloHash<AnyLinkable>

source

pub fn into_primitive(self) -> AnyLinkableHashPrimitive

Match on the primitive hash type represented by this composite hash type

source

pub fn into_any_dht_hash(self) -> Option<HoloHash<AnyDht>>

Downcast to AnyDhtHash if this is not an external hash

source

pub fn into_action_hash(self) -> Option<HoloHash<Action>>

If this hash represents an ActionHash, return it, else None

source

pub fn into_entry_hash(self) -> Option<HoloHash<Entry>>

If this hash represents an EntryHash, return it, else None

source

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

pub fn into_external_hash(self) -> Option<HoloHash<External>>

If this hash represents an ExternalHash, return it, else None

source§

impl<T> HoloHash<T>where T: HashType,

source

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

source

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.

source

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.

source

pub fn hash_type(&self) -> &T

The HashType of this hash

source

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

source

pub fn get_raw_36(&self) -> &[u8]

Get 36-byte Vec which excludes the 3 byte prefix

source

pub fn get_raw_32(&self) -> &[u8]

Fetch just the core 32 bytes (without the 4 location bytes)

source

pub fn get_loc(&self) -> DhtLocation

Fetch the holo dht location for this hash

source

pub fn into_inner(self) -> Vec<u8, Global>

consume into the inner byte vector

source

pub fn to_hex(&self) -> String

Get the hex representation of the hash bytes

source§

impl<T> HoloHash<T>where T: HashType,

source

pub fn from_raw_32_and_type(hash: Vec<u8, Global>, hash_type: T) -> HoloHash<T>

Construct a HoloHash from a 32-byte hash. The 3 prefix bytes will be added based on the provided HashType, and the 4 location bytes will be computed.

source§

impl<P> HoloHash<P>where P: PrimitiveHashType,

source

pub fn from_raw_36(hash: Vec<u8, Global>) -> HoloHash<P>

Construct from 36 raw bytes, using the known PrimitiveHashType

source

pub fn from_raw_32(hash: Vec<u8, Global>) -> HoloHash<P>

Construct a HoloHash from a prehashed raw 32-byte slice. The location bytes will be calculated.

source§

impl<T> HoloHash<T>where T: HashTypeSync,

source

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,

source

pub async fn with_data<C>(content: &C) -> impl Future<Output = HoloHash<T>>where C: HashableContent<HashType = T>,

Asynchronously hash a reference to the given content to produce a HoloHash

Trait Implementations§

source§

impl AnyLinkableHashExt for HoloHash<AnyLinkable>

source§

fn into_kitsune(self) -> Arc<KitsuneBasis, Global>

convert into Arc<Kitsune> type
source§

fn into_kitsune_raw(self) -> KitsuneBasis

convert into Kitsune type
source§

fn to_kitsune(&self) -> Arc<KitsuneBasis, Global>

to Arc<Kitsune> type
source§

impl<'a> Arbitrary<'a> for HoloHash<AnyLinkable>

source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<AnyLinkable>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl<'a, P> Arbitrary<'a> for HoloHash<P>where P: PrimitiveHashType,

source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<HoloHash<P>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl<T> AsRef<[u8]> for HoloHash<T>where T: HashType,

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Clone for HoloHash<T>where T: Clone + HashType,

source§

fn clone(&self) -> HoloHash<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for HoloHash<T>where T: HashType,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Display for HoloHash<T>where T: HashType,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<HoloHash<Action>> for HoloHash<AnyLinkable>

source§

fn from(hash: HoloHash<Action>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHash<Agent>> for HoloHash<AnyLinkable>

source§

fn from(hash: HoloHash<Agent>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHash<AnyDht>> for HoloHash<AnyLinkable>

source§

fn from(hash: HoloHash<AnyDht>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHash<Entry>> for HoloHash<AnyLinkable>

source§

fn from(hash: HoloHash<Entry>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHash<External>> for HoloHash<AnyLinkable>

source§

fn from(hash: HoloHash<External>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHashB64<Action>> for HoloHash<AnyLinkable>

source§

fn from(h: HoloHashB64<Action>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl From<HoloHashB64<Entry>> for HoloHash<AnyLinkable>

source§

fn from(h: HoloHashB64<Entry>) -> HoloHash<AnyLinkable>

Converts to this type from the input type.
source§

impl<T> From<HoloHashB64<T>> for HoloHash<T>where T: HashType,

source§

fn from(original: HoloHashB64<T>) -> HoloHash<T>

Converts to this type from the input type.
source§

impl<T> FromSql for HoloHash<T>where T: HashType,

source§

fn column_result(value: ValueRef<'_>) -> Result<HoloHash<T>, FromSqlError>

Converts SQLite value into Rust value.
source§

impl<T> HasHash<T> for HoloHash<T>where T: HashType,

source§

fn as_hash(&self) -> &HoloHash<T>

Get the hash by reference
source§

fn into_hash(self) -> HoloHash<T>

Convert to the owned hash
source§

impl<T> Hash for HoloHash<T>where T: Hash + HashType,

source§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> IntoIterator for HoloHash<T>where T: HashType,

§

type Item = u8

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<HoloHash<T> as IntoIterator>::Item, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <HoloHash<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> Ord for HoloHash<T>where T: Ord + HashType,

source§

fn cmp(&self, other: &HoloHash<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T> PartialEq<HoloHash<T>> for HoloHash<T>where T: PartialEq<T> + HashType,

source§

fn eq(&self, other: &HoloHash<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd<HoloHash<T>> for HoloHash<T>where T: PartialOrd<T> + HashType,

source§

fn partial_cmp(&self, other: &HoloHash<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Serialize for HoloHash<T>where T: HashType,

source§

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<T> ToSql for HoloHash<T>where T: HashType,

source§

fn to_sql(&self) -> Result<ToSqlOutput<'_>, Error>

Converts Rust value to SQLite value
source§

impl<P> TryFrom<&String> for HoloHash<P>where P: PrimitiveHashType,

§

type Error = HoloHashError

The type returned in the event of a conversion error.
source§

fn try_from(s: &String) -> Result<HoloHash<P>, HoloHashError>

Performs the conversion.
source§

impl<P> TryFrom<&str> for HoloHash<P>where P: PrimitiveHashType,

§

type Error = HoloHashError

The type returned in the event of a conversion error.
source§

fn try_from(s: &str) -> Result<HoloHash<P>, HoloHashError>

Performs the conversion.
source§

impl<T> TryFrom<SerializedBytes> for HoloHash<T>where T: HashType,

§

type Error = SerializedBytesError

The type returned in the event of a conversion error.
source§

fn try_from(sb: SerializedBytes) -> Result<HoloHash<T>, SerializedBytesError>

Performs the conversion.
source§

impl<P> TryFrom<String> for HoloHash<P>where P: PrimitiveHashType,

§

type Error = HoloHashError

The type returned in the event of a conversion error.
source§

fn try_from(s: String) -> Result<HoloHash<P>, HoloHashError>

Performs the conversion.
source§

impl<T> Eq for HoloHash<T>where T: Eq + HashType,

source§

impl<T> StructuralEq for HoloHash<T>where T: HashType,

source§

impl<T> StructuralPartialEq for HoloHash<T>where T: HashType,