[][src]Struct holochain_core_types::dna::Dna

pub struct Dna {
    pub name: String,
    pub description: String,
    pub version: String,
    pub uuid: String,
    pub dna_spec_version: String,
    pub properties: Value,
    pub zomes: BTreeMap<String, Zome>,
}

Represents the top-level holochain dna object.

Fields

name: String

The top-level "name" of a holochain application.

description: String

The top-level "description" of a holochain application.

version: String

The semantic version of your holochain application.

uuid: String

A unique identifier to distinguish your holochain application.

dna_spec_version: String

Which version of the holochain dna spec does this represent?

properties: Value

Any arbitrary application properties can be included in this object.

zomes: BTreeMap<String, Zome>

An array of zomes associated with your holochain application.

Implementations

impl Dna[src]

pub fn new() -> Self[src]

Create a new in-memory dna structure with some default values.

Examples

use holochain_core_types::dna::Dna;

let dna = Dna::new();
assert_eq!("", dna.name);

pub fn to_json_pretty(&self) -> Result<String>[src]

Generate a pretty-printed json string from an in-memory dna struct.

Examples

use holochain_core_types::dna::Dna;

let dna = Dna::new();
println!("json: {}", dna.to_json_pretty().expect("DNA should serialize"));

pub fn get_zome(&self, zome_name: &str) -> Result<&Zome, DnaError>[src]

Return a Zome

pub fn get_trait<'a>(
    &'a self,
    zome: &'a Zome,
    trait_name: &str
) -> Option<&'a TraitFns>
[src]

Return a Zome's TraitFns from a Zome and a Trait name.

pub fn get_function_with_zome_name(
    &self,
    zome_name: &str,
    fn_name: &str
) -> Result<&FnDeclaration, DnaError>
[src]

Return a Zome Function declaration from a Zome name and Function name.

pub fn get_wasm_from_zome_name<T: Into<String>>(
    &self,
    zome_name: T
) -> Option<&DnaWasm>
[src]

Find a Zome and return it's WASM bytecode

pub fn get_trait_fns_with_zome_name(
    &self,
    zome_name: &str,
    trait_name: &str
) -> Result<&TraitFns, DnaError>
[src]

Return a Zome's Trait functions from a Zome name and trait name.

pub fn get_zome_name_for_app_entry_type(
    &self,
    app_entry_type: &AppEntryType
) -> Option<String>
[src]

Return the name of the zome holding a specified app entry_type

pub fn get_entry_type_def(&self, entry_type_name: &str) -> Option<&EntryTypeDef>[src]

Return the entry_type definition of a specified app entry_type

pub fn multihash(&self) -> Result<Vec<u8>, HolochainError>[src]

pub fn get_required_bridges(&self) -> Vec<Bridge>[src]

pub fn verify(&self) -> HcResult<()>[src]

Trait Implementations

impl AddressableContent for Dna[src]

impl Clone for Dna[src]

impl Debug for Dna[src]

impl Default for Dna[src]

fn default() -> Self[src]

Provide defaults for a dna object.

impl<'de> Deserialize<'de> for Dna[src]

impl Eq for Dna[src]

impl<'a> From<&'a Dna> for JsonString[src]

impl From<Dna> for JsonString[src]

impl Hash for Dna[src]

impl PartialEq<Dna> for Dna[src]

impl Serialize for Dna[src]

impl<'a> TryFrom<&'a JsonString> for Dna[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl TryFrom<JsonString> for Dna[src]

type Error = JsonError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Dna

impl Send for Dna

impl Sync for Dna

impl Unpin for Dna

impl UnwindSafe for Dna

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,