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
sourceimpl 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
sourceimpl 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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn get_all_coordinators(&self) -> Vec<Zome<CoordinatorZomeDef>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
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 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
sourceimpl<'arbitrary> Arbitrary<'arbitrary> for DnaDef
impl<'arbitrary> Arbitrary<'arbitrary> for DnaDef
sourcefn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<DnaDef, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<DnaDef, Error>
Self
from the given unstructured data. Read moresourcefn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<DnaDef, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<DnaDef, Error>
Self
from the entirety of the given
unstructured data. Read moresourceimpl<'de> Deserialize<'de> for DnaDef
impl<'de> Deserialize<'de> for DnaDef
sourcefn 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>,
sourceimpl HashableContent for DnaDef
impl HashableContent for DnaDef
sourcefn hash_type(&self) -> <DnaDef as HashableContent>::HashType
fn hash_type(&self) -> <DnaDef as HashableContent>::HashType
sourcefn hashable_content(&self) -> HashableContentBytes
fn hashable_content(&self) -> HashableContentBytes
sourceimpl Serialize for DnaDef
impl Serialize for DnaDef
sourcefn 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,
sourceimpl TryFrom<&DnaDef> for SerializedBytes
impl TryFrom<&DnaDef> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn try_from(t: &DnaDef) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &DnaDef) -> Result<SerializedBytes, SerializedBytesError>
sourceimpl TryFrom<DnaDef> for SerializedBytes
impl TryFrom<DnaDef> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn try_from(t: DnaDef) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: DnaDef) -> Result<SerializedBytes, SerializedBytesError>
sourceimpl TryFrom<SerializedBytes> for DnaDef
impl TryFrom<SerializedBytes> for DnaDef
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn 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> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn 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>
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
sourceimpl<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>,
sourcefn into_hashed(self) -> HoloHashed<C>
fn into_hashed(self) -> HoloHashed<C>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn 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 morefn 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.