Module holochain::prelude

source ·

Re-exports

Modules

Macros

  • Helper for ensuring the the proper number of bytes is used in various situations
  • Serialization for fixed arrays is generally not available in a way that can be derived. Being able to wrap fixed size arrays is important e.g. for crypto safety etc. so this is a simple way to implement serialization so that we can send these types between the host/guest.
  • 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
  • Helper macro for implementing ToSql, when using rusqlite as a dependency
  • Helper macro for implementing ToSql, when using rusqlite as a dependency
  • Cryptographic secrets are fiddly at the best of times.
  • Boilerplate shortcut for implementing TestVal on an item

Structs

Enums

  • Action contains variants for each type of action.
  • Enum to mirror Action for all the shared data required to build session actions. Does NOT hold any agent specific information.
  • A unit enum which just maps onto the different Action variants, without containing any extra data
  • Get either the full activity or just the status of the chain
  • The primitive hash types represented by this composite hash
  • The primitive hash types represented by this composite hash
  • Errors occurring while installing an AppBundle
  • The possible locations of an AppBundle
  • Container struct which uses the manifest_version field to determine which manifest version to deserialize to.
  • Rules to determine if and how a Cell will be created for this Dna
  • The status of an installed app.
  • A declaration of the side effects of a particular AppStatusTransition.
  • The AppStatus without the reasons.
  • Represents a state transition operation from one state to another
  • The various processes which run “autonomically”, aka subconsciously. These are currently not used.
  • Target of a block. Each target type has an ID and associated reason.
  • Identical structure to MustGetAgentActivityResponse except it includes the ChainFilterRange that was used to produce the response. Doesn’t need to be serialized because it is only used internally.
  • Represents access requirements for capability grants.
  • Represents a potentially valid access grant to a zome call. Zome call response will be Unauthorized without a valid grant.
  • Reason why we might want to block a cell.
  • Rules to determine if and how a Cell will be created for this Dna
  • Uninhabitable placeholder
  • Specifies what step should be taken to provision a cell while installing an App
  • Specify which Actions to allow through this filter.
  • The type of agent activity returned in this request
  • Defines several ways that queries can be restricted to a range. Notably hash bounded ranges disambiguate forks whereas sequence indexes do not as the same position can be found in many forks. The reason that this does NOT use native rust range traits is that the hash bounded queries MUST be inclusive otherwise the integrity and fork disambiguation logic is impossible. An exclusive range bound that does not include the final action tells us nothing about which fork to select between N forks of equal length that proceed it. With an inclusive hash bounded range the final action always points unambiguously at the “correct” fork that the range is over. Start hashes are not needed to provide this property so ranges can be hash terminated with a length of preceeding records to return only. Technically the seq bounded ranges do not imply any fork disambiguation and so could be a range but for simplicity we left the API symmetrical in boundedness across all enum variants. @TODO It may be possible to provide/implement RangeBounds in the case that a full sequence of records/actions is provided but it would need to be handled as inclusive first, to enforce the integrity of the query, then the exclusiveness achieved by simply removing the final record after the fact.
  • Status of the agent activity chain
  • Ways of specifying a clone cell.
  • Errors during conversion from RoleName to CloneId.
  • The source of coordinators to be installed, either as binary data, or from a path
  • Errors related to the secure primitive macro.
  • The various types of database, used to specify the list of databases to initialize
  • The sqlite synchronous level. Corresponds to the PRAGMA synchronous pragma. See sqlite documentation.
  • The strategy for database file system synchronization. Some databases like the cache can be safely rebuilt if corruption occurs due to using the faster DbSyncLevel::Off.
  • Return type for get_details calls. ActionHash returns a Record. EntryHash returns an Entry.
  • A unit of DHT gossip. Used to notify an authority of new (meta)data to hold as well as changes to the status of already held data.
  • A type for storing in databases that don’t need the actual data. Everything is a hash of the type except the signatures.
  • This enum is used to
  • The reason for an app being in a Disabled state.
  • Holochain DnaError type.
  • The enum which encompasses all versions of the DNA manifest, past and present.
  • The source of the DNA to be installed, either as binary data, or from a path
  • Structure holding the entry portion of a chain record.
  • Either a Action::Create or a Action::Update. These actions both create a new instance of an Entry.
  • Either an EntryDefIndex or one of:
  • The status of an Entry in the Dht
  • Errors involving app entry creation
  • Allows Actions which reference Entries to know what type of Entry it is referencing. Useful for examining Actions without needing to fetch the corresponding Entries.
  • Responses from a dht get. These vary is size depending on the level of metadata required
  • Describes the get call and what information the caller is concerned about. This helps the subconscious avoid unnecessary network calls.
  • The type of gossip module running this gossip.
  • A collection of zome/function pairs
  • Input to holochain hash function.
  • Output from the holochain hashing host function.
  • HashableContent can be expressed as “content”, or “prehashed”, which affects how a HoloHashed type will be constructed from it.
  • Error type for Holochain P2p.
  • Anything that can go wrong while calling a HostFnApi method
  • A human-readable timestamp which is represented/serialized as an RFC3339 when possible, and a microsecond integer count otherwise. Both representations can be deserialized to this type.
  • The result of the DNA initialization callback.
  • Some blank entry types to use for testing.
  • Reason why we might want to block an IP.
  • KitsuneP2p Error Type.
  • Maps directly to the tracing Levels but here to define the interface. See https://docs.rs/tracing-core/0.1.17/tracing_core/struct.Level.html
  • How do we match this link in queries?
  • Filter on a set of LinkTypes.
  • Response to a must_get_agent_activity call.
  • Method for connecting to other peers and broadcasting our AgentInfo
  • A action of one of the two types that create a new entry.
  • Same as NewEntryAction but takes actions as reference
  • Reason why we might want to block a node.
  • These are the operations that can be applied to Holochain data. Every Action produces a set of operations. These operations are each sent to an authority for validation.
  • Type for deriving ordering of DhtOps Don’t change the order of this enum unless you mean to change the order we process ops
  • The reason for an app being in a Paused state. NB: there is no way to manually pause an app.
  • Permission granted to a call
  • A preflight request can be accepted, or invalid, or valid but the local agent cannot accept it.
  • Whether we are willing to proxy on behalf of others
  • Proxy configuration options
  • Represents the different ways the entry_address reference within an action can be interpreted
  • The level of validation package required by an entry.
  • Defines either a persisted or ephemeral schedule for a schedule function. Persisted schedules survive a conductor reboot, ephemeral will not. Persisted schedules continue beyond irrecoverable errors, ephemeral do not.
  • Scheduling errors.
  • Errors related to the secure primitive macro.
  • Outcome of trying to find the action sequences in a filter.
  • A Signal is some information emitted from within Holochain out through an Interface
  • The various reasons for why an App is not in the Running state.
  • A Signal which originates from within the Holochain system, as opposed to from within a Cell
  • Configure the network bindings for underlying kitsune transports.
  • A full UnitEnum, or just the unit type of that UnitEnum
  • Unresolved dependencies that are either a set of hashes or an agent activity query.
  • The validation status for an op or record much of this happens in the subconscious an entry missing validation dependencies may cycle through Pending many times before finally reaching a final validation state or being abandoned
  • Input to the weigh callback. Includes an “unweighed” action, and Entry if applicable.
  • A action of one of the two types that create a new entry.
  • Condensed version of ops for sending across the wire.
  • Response to a zome call.
  • Just the definition of a Zome, without the name included. This exists mainly for use in HashMaps where ZomeDefs are keyed by ZomeName.
  • Anything that can go wrong while calling a HostFnApi method

Constants

Traits

  • Builder for non-genesis Actions
  • 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.
  • Helpers for constructing AgentActivity
  • Extension trait for holo/kitsune conversion
  • Extension trait for holo/kitsune conversion
  • Extension trait for holo/kitsune conversion
  • The API which a Chain Head Coordinator service must implement.
  • Add some convenience methods to the CHC trait
  • Abstraction over an item in a chain.
  • A data structure that can be deserialized from any data format supported by Serde.
  • Extension trait for holo/kitsune conversion
  • Extension trait for holo/kitsune conversion
  • A store of DnaFiles which can be accessed by DnaHash.
  • 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.
  • Holochain-specific FetchContext extension trait.
  • Anything which has an owned HoloHashOf.
  • Data that requires a validation status.
  • 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 wrapper around HolochainP2pSender that partially applies the dna_hash / agent_pub_key. I.e. a sender that is tied to a specific cell.
  • The HolochainP2pSender struct allows controlling the HolochainP2p actor instance.
  • Kitsune hashes are expected to be 36 bytes. The first 32 bytes are the proper hash. The final 4 bytes are a hash-of-the-hash that can be treated like a u32 “location”.
  • The interface to be implemented by the host, which handles various requests for data
  • A supertrait of KitsuneHost convenient for defining test handlers. Allows only specifying the methods you care about, and letting all the rest throw errors if called
  • 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 trait for being generic over DbWrite and DbRead that both implement read access.
  • Extension trait to keep zome types minimal
  • A data structure that can be serialized into any data format supported by Serde.
  • Extension trait to keep zome types minimal
  • 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

Derive Macros