[][src]Crate hdk

Holochain Development Kit (HDK)

The HDK helps in writing Holochain applications. Holochain DNAs need to be written in WebAssembly, or a language that compiles to Wasm, such as Rust. The HDK handles some of the low-level details of Wasm execution like memory allocation, (de)serializing data, and shuffling data and functions into and out of Wasm memory via some helper functions and Holochain-specific macros.

The HDK lets the developer focus on application logic and, as much as possible, forget about the underlying low-level implementation. It would be possible to write DNA source code without an HDK, but it would be extremely tedious!

Re-exports

pub extern crate serde;
pub extern crate holochain_core_types;
pub extern crate holochain_wasm_utils;
pub use crate::api::*;

Modules

api
entry_definition
error
global_fns
globals

Holds the internal/private globals used by the zome api library. Also contains the functions declarations of the external functions provided by the Ribosome.

init_globals

Holds the internal/private zome API function init_globals which initializes the Zome API Globals with the values it receives from the Ribosome. It is automatically called at startup of each Zome function call.

macros
meta

Macros

define_zome

Every Zome must utilize the define_zome macro in the main library file in their Zome. The define_zome macro has 3 component parts:

entry

The entry macro is a helper for creating ValidatingEntryType definitions for use within the define_zome macro. It has 7 component parts:

from

The from macro is a helper for creating ValidatingEntryType definitions for use within the entry macro. It is a convenience wrapper around link! that has all the same properties except for the direction which gets set to LinkDirection::From.

link

The link macro is a helper for creating ValidatingEntryType definitions for use within the entry macro. It has 5 component parts:

to

The to macro is a helper for creating ValidatingEntryType definitions for use within the entry macro. It is a convenience wrapper around link! that has all the same properties except for the direction which gets set to LinkDirection::To.

Structs

EntryValidationArgs
LinkValidationArgs
LinkValidationPackageArgs
ValidationData

This structs carries information contextual for the process of validating an entry of link and is passed in to the according callbacks.

ValidationPackage

Enums

EntryAction
EntryLifecycle
LinkAction
LinkDirection
ValidationPackageDefinition