Module holochain_types::dna[][src]

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.

HoloHash Error 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, and uses a PrimitiveHashType

Structs

A bundle of Wasm zomes, respresented as a file.

Represents a full DNA, including DnaDef and WebAssembly bytecode.

The structure of data that goes in the DNA bundle manifest, i.e. “dna.yaml”

The structure of data that goes in the DNA bundle manifest, i.e. “dna.yaml”

Key for the EntryDef buffer

A newtype for a collection of EntryHashes, needed for some wasm return types.

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 to denote that deserialization should /// base-64 strings rather than raw byte arrays

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.

A readable and writable store of DnaFiles and EntryDefs

Wasms need to be an ordered map from WasmHash to a wasm::DnaWasm

Manifest for an individual Zome

Enums

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 readable and writable store of DnaFiles and EntryDefs

Read-only access to a DnaStore, and only for DNAs

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 PARSE for holo hash REPR

internal PARSE for holo hash REPR

internal REPR for holo hash

Type Definitions

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 HeaderHash

Base64-ready version of AnyDhtHash

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 a Header

Base64-ready version of HeaderHash

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

The hash of some wasm bytecode

Base64-ready version of WasmHash

Alias for a suitable representation of zome location