Struct holochain::sweettest::SweetDnaFile
source · pub struct SweetDnaFile(_);
Expand description
Helpful constructors for DnaFiles used in tests
Implementations§
source§impl SweetDnaFile
impl SweetDnaFile
sourcepub async fn from_bundle(path: &Path) -> DnaResult<DnaFile>
pub async fn from_bundle(path: &Path) -> DnaResult<DnaFile>
Create a DnaFile from a path to a *.dna bundle
sourcepub async fn from_bundle_with_overrides<P, E>(
path: &Path,
modifiers: DnaModifiersOpt<P>
) -> DnaResult<DnaFile>where
P: TryInto<SerializedBytes, Error = E>,
SerializedBytesError: From<E>,
pub async fn from_bundle_with_overrides<P, E>(
path: &Path,
modifiers: DnaModifiersOpt<P>
) -> DnaResult<DnaFile>where
P: TryInto<SerializedBytes, Error = E>,
SerializedBytesError: From<E>,
Create a DnaFile from a path to a *.dna bundle, applying the specified modifier overrides
sourcepub async fn from_zomes<I, C, D>(
network_seed: String,
integrity_zomes: Vec<I>,
coordinator_zomes: Vec<C>,
wasms: Vec<D>,
properties: SerializedBytes
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
I: Into<IntegrityZome>,
C: Into<CoordinatorZome>,
D: Into<DnaWasm>,
pub async fn from_zomes<I, C, D>(
network_seed: String,
integrity_zomes: Vec<I>,
coordinator_zomes: Vec<C>,
wasms: Vec<D>,
properties: SerializedBytes
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
I: Into<IntegrityZome>,
C: Into<CoordinatorZome>,
D: Into<DnaWasm>,
Create a DnaFile from a collection of Zomes
sourcepub async fn unique_from_zomes<I, C, D>(
integrity_zomes: Vec<I>,
coordinator_zomes: Vec<C>,
wasms: Vec<D>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
I: Into<IntegrityZome>,
C: Into<CoordinatorZome>,
D: Into<DnaWasm>,
pub async fn unique_from_zomes<I, C, D>(
integrity_zomes: Vec<I>,
coordinator_zomes: Vec<C>,
wasms: Vec<D>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
I: Into<IntegrityZome>,
C: Into<CoordinatorZome>,
D: Into<DnaWasm>,
Create a DnaFile from a collection of Zomes, with a random network seed
sourcepub async fn from_test_wasms<W>(
network_seed: String,
wasms: Vec<W>,
properties: SerializedBytes
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
W: Into<TestWasmPair<IntegrityZome, CoordinatorZome>> + Into<TestWasmPair<DnaWasm>> + Clone,
pub async fn from_test_wasms<W>(
network_seed: String,
wasms: Vec<W>,
properties: SerializedBytes
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
W: Into<TestWasmPair<IntegrityZome, CoordinatorZome>> + Into<TestWasmPair<DnaWasm>> + Clone,
Create a DnaFile from a collection of TestWasm
sourcepub async fn unique_from_test_wasms<W>(
test_wasms: Vec<W>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
W: Into<TestWasmPair<IntegrityZome, CoordinatorZome>> + Into<TestWasmPair<DnaWasm>> + Clone,
pub async fn unique_from_test_wasms<W>(
test_wasms: Vec<W>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)where
W: Into<TestWasmPair<IntegrityZome, CoordinatorZome>> + Into<TestWasmPair<DnaWasm>> + Clone,
Create a DnaFile from a collection of TestWasm with a random network seed
sourcepub async fn from_inline_zomes(
network_seed: String,
zomes: impl Into<InlineZomeSet>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
pub async fn from_inline_zomes(
network_seed: String,
zomes: impl Into<InlineZomeSet>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
Create a DnaFile from a collection of InlineZomes (no Wasm)
sourcepub async fn unique_from_inline_zomes(
zomes: impl Into<InlineZomeSet>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
pub async fn unique_from_inline_zomes(
zomes: impl Into<InlineZomeSet>
) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
Create a DnaFile from a collection of InlineZomes (no Wasm), with a random network seed
Methods from Deref<Target = DnaFile>§
sourcepub fn dna(&self) -> &HoloHashed<DnaDef>
pub fn dna(&self) -> &HoloHashed<DnaDef>
The DnaDef along with its hash
sourcepub fn verify_hash(&self) -> Result<(), DnaError>
pub fn verify_hash(&self) -> Result<(), DnaError>
Verify that the DNA hash in the file matches the DnaDef
sourcepub fn code(&self) -> &BTreeMap<HoloHash<Wasm>, DnaWasm, Global>
pub fn code(&self) -> &BTreeMap<HoloHash<Wasm>, DnaWasm, Global>
The bytes of the WASM zomes referenced in the Dna portion.
sourcepub fn get_wasm_for_zome(
&self,
zome_name: &ZomeName
) -> Result<&DnaWasm, DnaError>
pub fn get_wasm_for_zome(
&self,
zome_name: &ZomeName
) -> Result<&DnaWasm, DnaError>
Fetch the Webassembly byte code for a zome.
sourcepub async fn to_file_content(
&self
) -> impl Future<Output = Result<Vec<u8, Global>, DnaError>>
👎Deprecated: remove after app bundles become standard; use DnaBundle instead
pub async fn to_file_content(
&self
) -> impl Future<Output = Result<Vec<u8, Global>, DnaError>>
Render this dna_file as bytecode to send over the wire, or store in a file.
sourcepub fn update_modifiers(
&self,
dna_modifiers: DnaModifiersOpt<SerializedBytes>
) -> DnaFile
pub fn update_modifiers(
&self,
dna_modifiers: DnaModifiersOpt<SerializedBytes>
) -> DnaFile
Change the DNA modifiers – the network seed, origin time and properties – while leaving the actual DNA code intact.
Trait Implementations§
source§impl AsRef<DnaFile> for SweetDnaFile
impl AsRef<DnaFile> for SweetDnaFile
source§impl Borrow<DnaFile> for SweetDnaFile
impl Borrow<DnaFile> for SweetDnaFile
source§impl Clone for SweetDnaFile
impl Clone for SweetDnaFile
source§fn clone(&self) -> SweetDnaFile
fn clone(&self) -> SweetDnaFile
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SweetDnaFile
impl Debug for SweetDnaFile
source§impl Deref for SweetDnaFile
impl Deref for SweetDnaFile
source§impl From<DnaFile> for SweetDnaFile
impl From<DnaFile> for SweetDnaFile
source§fn from(original: DnaFile) -> SweetDnaFile
fn from(original: DnaFile) -> SweetDnaFile
source§impl From<SweetDnaFile> for DnaFile
impl From<SweetDnaFile> for DnaFile
source§fn from(original: SweetDnaFile) -> Self
fn from(original: SweetDnaFile) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for SweetDnaFile
impl Send for SweetDnaFile
impl Sync for SweetDnaFile
impl Unpin for SweetDnaFile
impl !UnwindSafe for SweetDnaFile
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
§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<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> 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.