pub struct DeployFile { /* private fields */ }Expand description
Represents deployed Yagna Wasm image with set up volumes inside the container.
A handle to the deployed image can be obtained after ya_runtime_wasi::deploy
command was executed, however, then the image will not have been yet validated. To
obtain a handle to a validated image you must run ya_runtime_wasi::start first.
§Example
use std::path::Path;
use ya_runtime_wasi::{deploy, DeployFile, start};
deploy(Path::new("workspace"), Path::new("package.zip")).unwrap();
let not_validated = DeployFile::load(Path::new("workspace")).unwrap();
start(Path::new("workspace")).unwrap();
let validated = DeployFile::load(Path::new("workspace")).unwrap();Implementations§
Source§impl DeployFile
impl DeployFile
Sourcepub fn load(work_dir: impl AsRef<Path>) -> Result<Self>
pub fn load(work_dir: impl AsRef<Path>) -> Result<Self>
Loads deployed image from workspace where ya_runtime_wasi::deploy was executed.
Sourcepub fn image_path(&self) -> &Path
pub fn image_path(&self) -> &Path
Returns path to the deployed image.
Sourcepub fn vols(&self) -> impl Iterator<Item = &ContainerVolume>
pub fn vols(&self) -> impl Iterator<Item = &ContainerVolume>
Returns an iterator over mapped container volumes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DeployFile
impl<'de> Deserialize<'de> for DeployFile
Source§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
Auto Trait Implementations§
impl Freeze for DeployFile
impl RefUnwindSafe for DeployFile
impl Send for DeployFile
impl Sync for DeployFile
impl Unpin for DeployFile
impl UnwindSafe for DeployFile
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more