Struct holochain_types::app::AppBundle
source · [−]pub struct AppBundle(_);
Expand description
A bundle of an AppManifest and collection of DNAs
Implementations
sourceimpl AppBundle
impl AppBundle
sourcepub async fn new<R: IntoIterator<Item = (PathBuf, DnaBundle)>>(
manifest: AppManifest,
resources: R,
root_dir: PathBuf
) -> Result<Self, AppBundleError>
pub async fn new<R: IntoIterator<Item = (PathBuf, DnaBundle)>>(
manifest: AppManifest,
resources: R,
root_dir: PathBuf
) -> Result<Self, AppBundleError>
Create an AppBundle from a manifest and DNA files
sourcepub fn into_inner(self) -> Bundle<AppManifest>
pub fn into_inner(self) -> Bundle<AppManifest>
Convert to the inner Bundle
sourcepub async fn resolve_cells(
self,
agent: AgentPubKey,
_gamut: DnaGamut,
membrane_proofs: HashMap<AppRoleId, MembraneProof>
) -> Result<AppRoleResolution, AppBundleError>
pub async fn resolve_cells(
self,
agent: AgentPubKey,
_gamut: DnaGamut,
membrane_proofs: HashMap<AppRoleId, MembraneProof>
) -> Result<AppRoleResolution, AppBundleError>
Given a DnaGamut, decide which of the available DNAs or Cells should be used for each cell in this app.
Methods from Deref<Target = Bundle<AppManifest>>
sourcepub async fn write_to_file(
&'_ self,
path: &'_ Path
) -> Result<(), MrBundleError>
pub async fn write_to_file(
&'_ self,
path: &'_ Path
) -> Result<(), MrBundleError>
Write a Bundle to a file
sourcepub async fn resolve(
&'_ self,
location: &'_ Location
) -> Result<Cow<'_, Vec<u8, Global>>, MrBundleError>
pub async fn resolve(
&'_ self,
location: &'_ Location
) -> Result<Cow<'_, Vec<u8, Global>>, MrBundleError>
Retrieve the bytes for a resource at a Location, downloading it if necessary
sourcepub 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.
sourcepub 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
sourcepub fn bundled_resources(
&self
) -> &HashMap<PathBuf, Vec<u8, Global>, RandomState>
pub fn bundled_resources(
&self
) -> &HashMap<PathBuf, Vec<u8, Global>, RandomState>
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
sourcepub fn encode(&self) -> Result<Vec<u8, Global>, MrBundleError>
pub fn encode(&self) -> Result<Vec<u8, Global>, MrBundleError>
An arbitrary and opaque encoding of the bundle data into a byte array
sourcepub fn find_root_dir(&self, path: &Path) -> Result<PathBuf, MrBundleError>
pub fn find_root_dir(&self, path: &Path) -> Result<PathBuf, MrBundleError>
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.
sourcepub 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
sourceimpl AsRef<Bundle<AppManifest>> for AppBundle
impl AsRef<Bundle<AppManifest>> for AppBundle
sourcefn as_ref(&self) -> &Bundle<AppManifest>
fn as_ref(&self) -> &Bundle<AppManifest>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<Bundle<AppManifest>> for AppBundle
impl Borrow<Bundle<AppManifest>> for AppBundle
sourcefn borrow(&self) -> &Bundle<AppManifest>
fn borrow(&self) -> &Bundle<AppManifest>
Immutably borrows from an owned value. Read more
sourceimpl<'de> Deserialize<'de> for AppBundle
impl<'de> Deserialize<'de> for AppBundle
sourcefn 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
sourceimpl From<Bundle<AppManifest>> for AppBundle
impl From<Bundle<AppManifest>> for AppBundle
sourcefn from(original: Bundle<AppManifest>) -> AppBundle
fn from(original: Bundle<AppManifest>) -> AppBundle
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for AppBundle
impl Send for AppBundle
impl Sync for AppBundle
impl Unpin for AppBundle
impl UnwindSafe for AppBundle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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> 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>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more