Struct holochain_types::dna::DnaBundle
source · [−]pub struct DnaBundle(_);
Expand description
A bundle of Wasm zomes, respresented as a file.
Implementations
Constructor
Convert to a DnaFile, and return what the hash of the Dna would have been without the provided phenotype overrides
Read from a bundle file
pub fn to_dna_def(
&self,
zomes: Zomes,
uid: Option<Uid>,
properties: Option<YamlProperties>
) -> DnaResult<(DnaDefHashed, DnaHash)>
pub fn to_dna_def(
&self,
zomes: Zomes,
uid: Option<Uid>,
properties: Option<YamlProperties>
) -> DnaResult<(DnaDefHashed, DnaHash)>
Convert to a DnaDef
Build a bundle from a DnaFile. Useful for tests.
Methods from Deref<Target = Bundle<DnaManifest>>
Write a Bundle to a file
Retrieve the bytes for a resource at a Location, downloading it if necessary
pub async fn resolve_all(
&'_ self
) -> Result<HashMap<Location, Cow<'_, Vec<u8, Global>>, RandomState>, MrBundleError>
pub async fn resolve_all(
&'_ self
) -> Result<HashMap<Location, Cow<'_, Vec<u8, Global>>, RandomState>, MrBundleError>
Return the full set of resources specified by this bundle’s manifest. References to bundled resources can be returned directly, while all others will be fetched from the filesystem or the network.
pub async fn resolve_all_cloned(
&'_ self
) -> Result<HashMap<Location, Vec<u8, Global>, RandomState>, MrBundleError>
pub async fn resolve_all_cloned(
&'_ self
) -> Result<HashMap<Location, Vec<u8, Global>, RandomState>, MrBundleError>
Resolve all resources, but with fully owned references
Access the map of resources included in this bundle
Bundled resources are also accessible via resolve
or resolve_all
,
but using this method prevents a Clone
An arbitrary and opaque encoding of the bundle data into a byte array
Given that the Manifest is located at the given absolute path
, find
the absolute root directory for the “unpacked” Bundle directory.
Useful when “imploding” a directory into a bundle to determine the
default location of the generated Bundle file.
This will only be different than the Manifest path itself if the Manifest::path impl specifies a nested path.
Will return None if the path
does not actually end with the
manifest relative path, meaning that either the manifest file is
misplaced within the unpacked directory, or an incorrect path was
supplied.
pub async fn unpack_yaml(
&'_ self,
base_path: &'_ Path,
force: bool
) -> Result<(), MrBundleError>
pub async fn unpack_yaml(
&'_ self,
base_path: &'_ Path,
force: bool
) -> Result<(), MrBundleError>
Create a directory which contains the manifest as a YAML file,
and each resource written to its own file (as raw bytes)
The paths of the resources are specified by the paths of the bundle,
and the path of the manifest file is specified by the Manifest::path
trait method implementation of the M
type.
Trait Implementations
Performs the conversion.
Immutably borrows from an owned value. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DnaBundle
impl UnwindSafe for DnaBundle
Blanket Implementations
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
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>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more