pub struct RuntimeBundle { /* private fields */ }Expand description
An opened bundle: its manifest, and access to its assets.
Opening one parses manifest.json and does nothing else. A participant not
named in the manifest opens the bundle exactly as one that is - the manifest
is the robot model plus, for those that have one, their own configuration -
so there is no selection step and no way for a launched process to be refused
by the bundle it was pointed at.
Implementations§
Source§impl RuntimeBundle
impl RuntimeBundle
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self, BundleError>
pub fn open(root: impl AsRef<Path>) -> Result<Self, BundleError>
Open one installed bundle.
§Errors
Returns BundleError::Root or BundleError::NotDirectory when
root is not a directory, BundleError::ReadManifest when
manifest.json cannot be read, and BundleError::ManifestJson when it
is not a document this train understands.
Sourcepub const fn manifest(&self) -> &ManifestDocument
pub const fn manifest(&self) -> &ManifestDocument
The persisted document, tag included.
Sourcepub fn asset(&self, id: &AssetId) -> Result<Vec<u8>, BundleError>
pub fn asset(&self, id: &AssetId) -> Result<Vec<u8>, BundleError>
Read one asset out of <bundle>/assets.
§Errors
Returns the same failures as ParticipantAssets::read.
Sourcepub const fn assets(&self) -> &ParticipantAssets
pub const fn assets(&self) -> &ParticipantAssets
The asset reader, for a consumer that keeps it beyond this value.
Trait Implementations§
Source§impl Clone for RuntimeBundle
impl Clone for RuntimeBundle
Source§fn clone(&self) -> RuntimeBundle
fn clone(&self) -> RuntimeBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more