pub struct DnaDef {
pub name: String,
pub modifiers: DnaModifiers,
pub integrity_zomes: Vec<(ZomeName, IntegrityZomeDef), Global>,
pub coordinator_zomes: Vec<(ZomeName, CoordinatorZomeDef), Global>,
}
Expand description
The definition of a DNA: the hash of this data is what produces the DnaHash.
Historical note: This struct was written before DnaManifest
appeared.
It is included as part of a DnaFile
. There is still a lot of code that uses
this type, but in function, it has mainly been superseded by DnaManifest
.
Hence, this type can basically be thought of as a fully validated, normalized
DnaManifest
Fields§
§name: String
The friendly “name” of a Holochain DNA.
modifiers: DnaModifiers
Modifiers of this DNA - the network seed, properties and origin time - as opposed to the actual DNA code. The modifiers are included in the DNA hash computation.
integrity_zomes: Vec<(ZomeName, IntegrityZomeDef), Global>
A vector of zomes associated with your DNA.
coordinator_zomes: Vec<(ZomeName, CoordinatorZomeDef), Global>
A vector of zomes that do not affect
the DnaHash
.
Implementations§
source§impl DnaDef
impl DnaDef
sourcepub fn unique_from_zomes(
integrity: Vec<Zome<IntegrityZomeDef>, Global>,
coordinator: Vec<Zome<CoordinatorZomeDef>, Global>
) -> DnaDef
pub fn unique_from_zomes( integrity: Vec<Zome<IntegrityZomeDef>, Global>, coordinator: Vec<Zome<CoordinatorZomeDef>, Global> ) -> DnaDef
Create a DnaDef with a random network seed, useful for testing
source§impl DnaDef
impl DnaDef
sourcepub fn get_integrity_zome(
&self,
zome_name: &ZomeName
) -> Result<Zome<IntegrityZomeDef>, ZomeError>
pub fn get_integrity_zome( &self, zome_name: &ZomeName ) -> Result<Zome<IntegrityZomeDef>, ZomeError>
Find an integrity zome from a ZomeName
.
sourcepub fn is_integrity_zome(&self, zome_name: &ZomeName) -> bool
pub fn is_integrity_zome(&self, zome_name: &ZomeName) -> bool
Check if a zome is an integrity zome.
sourcepub fn get_coordinator_zome(
&self,
zome_name: &ZomeName
) -> Result<Zome<CoordinatorZomeDef>, ZomeError>
pub fn get_coordinator_zome( &self, zome_name: &ZomeName ) -> Result<Zome<CoordinatorZomeDef>, ZomeError>
Find a coordinator zome from a ZomeName
.
sourcepub fn get_zome(&self, zome_name: &ZomeName) -> Result<Zome<ZomeDef>, ZomeError>
pub fn get_zome(&self, zome_name: &ZomeName) -> Result<Zome<ZomeDef>, ZomeError>
Find a any zome from a ZomeName
.
sourcepub fn get_all_coordinators(&self) -> Vec<Zome<CoordinatorZomeDef>, Global>
pub fn get_all_coordinators(&self) -> Vec<Zome<CoordinatorZomeDef>, Global>
Get all the CoordinatorZome
s for this dna
sourcepub fn get_wasm_zome(
&self,
zome_name: &ZomeName
) -> Result<&WasmZome, ZomeError>
pub fn get_wasm_zome( &self, zome_name: &ZomeName ) -> Result<&WasmZome, ZomeError>
Return a Zome, error if not a WasmZome
sourcepub fn get_wasm_zome_hash(
&self,
zome_name: &ZomeName
) -> Result<HoloHash<Wasm>, ZomeError>
pub fn get_wasm_zome_hash( &self, zome_name: &ZomeName ) -> Result<HoloHash<Wasm>, ZomeError>
Return the Wasm Hash for Zome, error if not a Wasm type Zome
sourcepub fn update_modifiers(
&self,
dna_modifiers: DnaModifiersOpt<SerializedBytes>
) -> DnaDef
pub fn update_modifiers( &self, dna_modifiers: DnaModifiersOpt<SerializedBytes> ) -> DnaDef
Change the DNA modifiers – the network seed, properties and origin time – while leaving the actual DNA code intact.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for DnaDef
impl<'arbitrary> Arbitrary<'arbitrary> for DnaDef
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<DnaDef, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<DnaDef, Error>
Self
from the given unstructured data. Read moresource§impl<'de> Deserialize<'de> for DnaDef
impl<'de> Deserialize<'de> for DnaDef
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<DnaDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<DnaDef, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl HashableContent for DnaDef
impl HashableContent for DnaDef
source§fn hash_type(&self) -> <DnaDef as HashableContent>::HashType
fn hash_type(&self) -> <DnaDef as HashableContent>::HashType
source§fn hashable_content(&self) -> HashableContentBytes
fn hashable_content(&self) -> HashableContentBytes
source§impl PartialEq<DnaDef> for DnaDef
impl PartialEq<DnaDef> for DnaDef
source§impl Serialize for DnaDef
impl Serialize for DnaDef
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl TryFrom<&DnaDef> for SerializedBytes
impl TryFrom<&DnaDef> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: &DnaDef) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &DnaDef) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<DnaDef> for SerializedBytes
impl TryFrom<DnaDef> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: DnaDef) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: DnaDef) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<SerializedBytes> for DnaDef
impl TryFrom<SerializedBytes> for DnaDef
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(sb: SerializedBytes) -> Result<DnaDef, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<DnaDef, SerializedBytesError>
impl Eq for DnaDef
impl StructuralEq for DnaDef
impl StructuralPartialEq for DnaDef
Auto Trait Implementations§
impl !RefUnwindSafe for DnaDef
impl Send for DnaDef
impl Sync for DnaDef
impl Unpin for DnaDef
impl !UnwindSafe for DnaDef
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T, C> HashableContentExtSync<T> for Cwhere
T: HashTypeSync,
C: HashableContent<HashType = T>,
impl<T, C> HashableContentExtSync<T> for Cwhere T: HashTypeSync, C: HashableContent<HashType = T>,
source§fn into_hashed(self) -> HoloHashed<C>
fn into_hashed(self) -> HoloHashed<C>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.