Module holochain_types::dna
source · Expand description
dna is a library for working with holochain dna files/entries.
It includes utilities for representing dna structures in memory, as well as serializing and deserializing dna, mainly to json format.
Re-exports§
pub use error::DnaError;
Modules§
- Include nice string encoding methods and From impls
- Holochain DnaError type.
- Defines the prefixes for the various HashTypes, as well as the traits which unify them
- crate::dna::wasm is a module for managing webassembly code
Macros§
- Helper for ensuring the the proper number of bytes is used in various situations
- A default HashableContent implementation, suitable for content which is already
TryInto<SerializedBytes>
, and uses a PrimitiveHashType
Structs§
- Error converting a composite hash into a subset composite hash, due to type mismatch
- A bundle of coordinator zomes.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Coordinator zomes.
- A bundle of Wasm zomes, respresented as a file.
- Represents a full DNA, including DnaDef and WebAssembly bytecode.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. The structure of data that goes in the DNA bundle manifest “dna.yaml”.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Builder for
DnaManifestV1
. - Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. The structure of data that goes in the DNA bundle manifest “dna.yaml”.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Builder for
DnaManifestV1
. - Key for the EntryDef buffer
- A newtype for a collection of EntryHashes, needed for some wasm return types.
- Error converting a composite hash into a primitive one, due to type mismatch
- 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.
- A wrapper around HoloHash that
Serialize
s into a base64 string rather than a raw byte array. - 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.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Manifest for all items that will change the
DnaHash
. - Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Builder for
IntegrityManifest
. - A dna manifest that has been successfully validated.
- Wasms need to be an ordered map from WasmHash to a wasm::DnaWasm
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Manifest for integrity zomes that another zome depends on.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Manifest for an individual Zome
Enums§
- The primitive hash types represented by this composite hash
- The primitive hash types represented by this composite hash
- The enum which encompasses all versions of the DNA manifest, past and present.
- HashableContent can be expressed as “content”, or “prehashed”, which affects how a HoloHashed type will be constructed from it.
Constants§
- Length of the core bytes (32)
- Length of the full HoloHash bytes (39 = 3 + 32 + 4)
- Length of the location bytes (4)
- Length of the prefix bytes (3)
- Length of the core bytes + the loc bytes (36 = 32 + 4), i.e. everything except the type prefix
- The maximum size to hash synchronously. Anything larger than this will take too long to hash within a single tokio context
Traits§
- A store of DnaFiles which can be accessed by DnaHash.
- 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.
- Adds convenience methods for constructing HoloHash and HoloHashed from some HashableContent
- Adds convenience methods for constructing HoloHash and HoloHashed from some HashableContent
- 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.
Functions§
- internal compute a 32 byte blake2b hash
- internal PARSE for holo hash REPR
- internal PARSE for holo hash REPR
- internal REPR for holo hash
Type Aliases§
- The hash of an action
- Base64-ready version of ActionHash
- An Agent public signing key. Not really a hash, more of an “identity hash”.
- Base64-ready version of AgentPubKey
- The hash of anything referrable in the DHT. This is a composite of either an EntryHash or a ActionHash
- Base64-ready version of AnyDhtHash
- The hash of anything linkable.
- Base64-ready version of AnyLinkableHash
- The hash of a DhtOp’s “unique form” representation
- Base64-ready version of DhtOpHash
- The hash of a DnaDef
- Base64-ready version of DnaHash
- The hash of an Entry.
- Base64-ready version of EntryHash
- The hash of some external data that can’t or doesn’t exist on the DHT.
- Base64-ready version of ExternalHash
- A convenience type, for specifying a hash by HashableContent rather than by its HashType
- The hash of a network ID
- Base64-ready version of NetIdHash
- Alias for AnyLinkableHash. This hash forms the notion of the “basis hash” of an op.
- The hash of some wasm bytecode
- Base64-ready version of WasmHash
- A public key of a pair of signing keys for signing zome calls.
- Re-export the current version. When creating a new version, just re-export the new version, and update the code accordingly. Alias for a suitable representation of zome location