Module hdi::prelude

source ·
Expand description

Exports common types and functions according to the Rust prelude pattern.

Re-exports§

Modules§

Macros§

  • Implements conversion traits to allow a struct to be handled as an app entry. If you have some need to implement custom serialization logic or metadata injection you can do so by implementing these traits manually instead.
  • Helper for ensuring the the proper number of bytes is used in various situations
  • unidiomatic way to derive default trait implementations of TryFrom in/out of SerializedBytes
  • A default HashableContent implementation, suitable for content which is already TryInto<SerializedBytes>, and uses a PrimitiveHashType
  • A simple macro to wrap return_err_ptr in an analogy to the native rust ?.
  • Helper macro for returning an error from a WASM.

Structs§

  • Action for an agent validation package, used to determine whether an agent is allowed to participate in this DNA
  • Newtype for the bytes comprising an App entry
  • Information about a class of Entries provided by the DNA
  • Identifier for an entry definition. This may be removed.
  • An ordered set based on a B-Tree.
  • System entry to hold a capability token claim for use as a caller. Stored by a claimant so they can remember what’s necessary to exercise this capability by sending the secret to the grantor.
  • A CapSecret is used by a caller to prove to a callee access to a committed CapGrant.
  • Filter source chain items. Starting from some chain position given as an ActionHash the chain is walked backwards to genesis. The filter can stop early by specifying the number of chain items to take and / or an ActionHash to consume until.
  • When migrating to a new version of a DNA, this action is committed to the old chain to declare the migration path taken.
  • Input to close a chain.
  • Error converting a composite hash into a subset composite hash, due to type mismatch
  • Every countersigning agent must sign against their chain state. The chain must be frozen until each agent decides to sign or exit the session.
  • All the data required for a countersigning session.
  • Every countersigning session must complete a full set of actions between the start and end times to be valid.
  • An action which “speaks” Entry content into being. The same content can be referenced by multiple such actions.
  • Base data for Create actions.
  • Declares that a metadata Link should be made between two EntryHashes
  • Declare that a previously published Action should be nullified and considered deleted.
  • Placeholder for future when we want to have deletes on actions Not currently in use.
  • Declares that a previously made Link should be nullified and considered removed.
  • The Dna Action is always the first action in a source chain
  • Information about the current DNA.
  • Information about the current DNA.
  • Modifiers of this DNA - the network seed, properties and origin time - as opposed to the actual DNA code. These modifiers are included in the DNA hash computation.
  • DnaModifiers options of which all are optional.
  • All definitions for all entry types in an integrity zome.
  • A newtype for a collection of EntryHashes, needed for some wasm return types.
  • Combination of the three main rate limiting data types, for convenience
  • The output of ephemeral signing. The private key for this public key has been discarded by this point. The signatures match the public key provided but cannot be reproduced or forged because the private key no longer exists. The signatures match the input items positionally in the vector, it is up to the caller to reconstruct/align/zip them back together.
  • A single function name.
  • Data passed into the genesis_self_check callback for verifying the initial chain entries
  • Data passed into the genesis_self_check callback for verifying the initial chain entries. DnaInfo can be read with a call to dna_info within the self check callback, it is elided here to minimise/stabilise the callback function signature.
  • 256 Bit generic hash.
  • 512 Bit generic hash.
  • Error converting a composite hash into a primitive one, due to type mismatch
  • A hash set implemented as a HashMap where the value is ().
  • A HoloHash contains a vector of 36 bytes representing a 32-byte blake2b hash plus 4 bytes representing a DHT location. It also contains a zero-sized type which specifies what it is a hash of.
  • Represents some piece of content along with its hash representation, so that hashes need not be calculated multiple times. Provides an easy constructor which consumes the content.
  • It’s an interval bounded by timestamps that are not infinite.
  • An action which declares that all zome init functions have successfully completed, and the chain is ready for commits. Contains no explicit data.
  • Opaque tag for the link applied at the app layer, used to differentiate between different semantics and validation rules for different links
  • Zome input for must_get_action.
  • Input to the must_get_agent_activity call.
  • Zome input for must_get_entry.
  • Zome input for must_get_valid_record.
  • When migrating to a new version of a DNA, this action is committed to the new chain to declare the migration path taken.
  • Input to open a chain.
  • Every preflight request can have optional arbitrary bytes that can be agreed to.
  • The same PreflightRequest is sent to every agent. Each agent signs this data as part of their PreflightResponse. Every preflight must be identical and signed by every agent for a session to be valid.
  • Every agent must send back a preflight response. All the preflight response data is signed by each agent and included in the session data.
  • Combination of two rate limiting data types, for convenience
  • a chain record containing the signed action along with the entry if the action type has one.
  • Registers a new Action on an agent source chain. This is the act of creating any Action and publishing it to the DHT.
  • Registers a link between two Entrys. This is the act of creating a Action::CreateLink and publishing it to the DHT. The authority is the entry authority for the base Entry.
  • Registers a deletion of an instance of an Entry in the DHT. This is the act of creating a Action::Delete and publishing it to the DHT.
  • Deletes a link between two Entrys. This is the act of creating a Action::DeleteLink and publishing it to the DHT. The delete always references a specific Action::CreateLink.
  • Registers an update from an instance of an Entry in the DHT. This is the act of creating a Action::Update and publishing it to the DHT. Note that the Action::Update stores an new instance of an Entry and registers it as an update to the original Entry. This operation is only concerned with registering the update.
  • The number of validations required for an entry to be considered published.
  • Agents can have a role specific to each countersigning session. The role is app defined and opaque to the subconscious.
  • A type with the zome that it is defined in.
  • zome types that are in scope for the calling zome.
  • The set of EntryDefIndex and LinkTypes in scope for the calling zome.
  • A Canonical Serialized Bytes representation for data If you have a data structure that needs a canonical byte representation use this Always round-trip through SerializedBytes via. a single TryFrom implementation. This ensures that the internal bytes of SerializedBytes are indeed canonical. The corrolary is that if bytes are NOT wrapped in SerializedBytes we can assume they are NOT canonical. Typically we need a canonical serialization when data is to be handled at the byte level by independently implemented and maintained systems.
  • The raw bytes of a signature.
  • Any content that has been hashed and signed.
  • Stores a new Entry in the DHT. This is the act of creating a either a Action::Create or a Action::Update and publishing it to the DHT. These actions create a new instance of an Entry.
  • Stores a new Record in the DHT. This is the act of creating a new Action and publishing it to the DHT. Note that not all Actions contain an Entry.
  • A microsecond-precision UTC timestamp for use in Holochain’s actions.
  • Representation of message to be logged via the debug host function
  • UnsafeBytes the only way to implement a custom round trip through bytes for SerializedBytes It is intended to be an internal implementation in TryFrom implementations The assumption is that any code using UnsafeBytes is NOT valid messagepack data This allows us to enforce that all data round-tripping through SerializedBytes is via TryFrom and also allow for custom non-messagepack canonical representations of data types.
  • An action which specifies that some new Entry content is intended to be an update to some old Entry.
  • Placeholder for future when we want to have updates on actions Not currently in use.
  • Base data for Update actions.
  • Mirror struct for Sign that includes a signature to verify against a key and data.
  • Wraps a WasmErrorInner with a file and line number. The easiest way to generate this is with the wasm_error! macro that will insert the correct file/line and can create strings by forwarding args to the format! macro.
  • Data that can be encrypted with secretbox.
  • Key refs represent shared secrets stored in the keystore. They can either be user-specified, or auto-generated at time of secret creation, or ingestion.
  • The entry for the ZomeCall capability grant. This data is committed to the callee’s source chain as a private entry. The remote calling agent must provide a secret and we source their pubkey from the active network connection. This must match the strictness of the CapAccess.
  • The index into the ZomeIndex vec.
  • this id is an internal reference, which also serves as a canonical ordering for zome initialization. The value should be auto-generated from the Zome Bundle def
  • The properties of the current dna/zome being called.
  • ZomeName as a String.
  • A key to the ScopedZomeTypes container.

Enums§

Constants§

Traits§

  • A trait to unify the “inner” parts of an Action, i.e. the structs inside the Action enum’s variants. This trait is used for the “unweighed” version of each struct, i.e. the version with weight information erased.
  • A trait to unify the “inner” parts of an Action, i.e. the structs inside the Action enum’s variants. This trait is used for the “weighed” version of each struct, i.e. the version without weight information erased.
  • A data structure that can be deserialized from any data format supported by Serde.
  • Trait for binding static EntryDef property access for a type. This trait maps a type to its corresponding EntryDef property at compile time.
  • Helper trait for deserializing Entrys to the correct type.
  • Anything which has an owned HoloHashOf.
  • Every HoloHash is generic over HashType. Additionally, every HashableContent has an associated HashType. The HashType is the glue that binds together HashableContent with its hash.
  • Any implementor of HashableContent may be used in a HoloHashed to pair data with its HoloHash representation. It also has an associated HashType.
  • A helper trait for finding the app defined link type from a ZomeIndex and LinkType.
  • A PrimitiveHashType is one with a multihash prefix. In contrast, a non-primitive hash type could be one of several primitive types, e.g. an AnyDhtHash can represent one of three primitive types.
  • A data structure that can be serialized into any data format supported by Serde.
  • Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of TryInto.
  • Trait to convert from dna properties into specified type
  • An attempted conversion that consumes self, which may or may not be expensive.
  • Helper trait for types that are internally represented as u8 but need to be used as indicies into containers.
  • A utility trait for associating a data enum with a unit enum that has the same variants.

Functions§

Type Aliases§

Attribute Macros§

Derive Macros§