pub struct SweetDnaFile(/* private fields */);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>
pub async fn from_bundle_with_overrides<P, E>( path: &Path, modifiers: DnaModifiersOpt<P>, ) -> DnaResult<DnaFile>
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>)
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>)
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>)
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>)
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>)
pub async fn from_test_wasms<W>( network_seed: String, wasms: Vec<W>, properties: SerializedBytes, ) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
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>)
pub async fn unique_from_test_wasms<W>( test_wasms: Vec<W>, ) -> (DnaFile, Vec<IntegrityZome>, Vec<CoordinatorZome>)
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
Sourcepub async fn unique_empty() -> DnaFile
pub async fn unique_empty() -> DnaFile
Create a unique DnaFile with no validation and no zome functions
Methods from Deref<Target = DnaFile>§
Sourcepub fn dna_def_hashed(&self) -> &HoloHashed<DnaDef>
pub fn dna_def_hashed(&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>
pub fn code(&self) -> &BTreeMap<HoloHash<Wasm>, DnaWasm>
The bytes of the WASM zomes referenced in the Dna portion.
Sourcepub fn inline_zomes(&self) -> &Vec<DynInlineZome>
pub fn inline_zomes(&self) -> &Vec<DynInlineZome>
The inline zomes.
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 fn update_modifiers(&self, dna_modifiers: DnaModifiersOpt) -> DnaFile
pub fn update_modifiers(&self, dna_modifiers: DnaModifiersOpt) -> DnaFile
Change the DNA modifiers 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 (const: unstable) · 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§impl From<SweetDnaFile> for DnaFile
impl From<SweetDnaFile> for DnaFile
Source§fn from(value: SweetDnaFile) -> Self
fn from(value: SweetDnaFile) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for SweetDnaFile
impl !UnwindSafe for SweetDnaFile
impl Freeze for SweetDnaFile
impl Send for SweetDnaFile
impl Sync for SweetDnaFile
impl Unpin for SweetDnaFile
impl UnsafeUnpin for SweetDnaFile
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.