pub struct OfflineVm { /* private fields */ }
Expand description
Defines a VM that has no online interaction and does everything locally.
Implementations§
source§impl OfflineVm
impl OfflineVm
sourcepub fn new(
docker_opts: DockerOptions,
keep_containers: bool,
package_dir: impl Into<PathBuf>,
dataset_dir: impl Into<PathBuf>,
results_dir: impl Into<PathBuf>,
package_index: Arc<PackageIndex>,
data_index: Arc<DataIndex>,
) -> Self
pub fn new( docker_opts: DockerOptions, keep_containers: bool, package_dir: impl Into<PathBuf>, dataset_dir: impl Into<PathBuf>, results_dir: impl Into<PathBuf>, package_index: Arc<PackageIndex>, data_index: Arc<DataIndex>, ) -> Self
Constructor for the OfflineVm that initializes it with the initial state.
§Arguments
docker_opts
: The information we need to connect to the local Docker daemon.keep_containers
: Whether to keep containers after execution completes or not.package_dir
: The directory where packages (and thus images) are stored.dataset_dir
: The directory where datasets (and thus committed results) are stored.results_dir
: The directory where temporary results are stored.package_index
: The PackageIndex to use to resolve packages.data_index
: The DataIndex to use to resolve data indices.
§Returns
A new OfflineVm instance with one coherent state.
sourcepub fn results_dir(&self) -> PathBuf
pub fn results_dir(&self) -> PathBuf
Returns the path to the internal temporary folder for results.
Trait Implementations§
source§impl Vm for OfflineVm
impl Vm for OfflineVm
source§type GlobalState = GlobalState
type GlobalState = GlobalState
The type of the thread-global extension to the runtime state.
source§type LocalState = ()
type LocalState = ()
The type of the thread-local extension to the runtime state.
source§fn store_state(
this: &Arc<RwLock<Self>>,
state: RunState<Self::GlobalState>,
) -> Result<(), Error>
fn store_state( this: &Arc<RwLock<Self>>, state: RunState<Self::GlobalState>, ) -> Result<(), Error>
A function that stores the given runtime state information in the parent struct. Read more
source§fn load_state(
this: &Arc<RwLock<Self>>,
) -> Result<RunState<Self::GlobalState>, Error>
fn load_state( this: &Arc<RwLock<Self>>, ) -> Result<RunState<Self::GlobalState>, Error>
A function that returns the VM’s runtime state in the parent struct. Read more
source§fn new_state(custom: Self::GlobalState) -> RunState<Self::GlobalState>
fn new_state(custom: Self::GlobalState) -> RunState<Self::GlobalState>
Initializes a new global state based on the given custom part. Read more
source§fn run<'life0, 'async_trait, P>(
this: Arc<RwLock<Self>>,
snippet: Workflow,
prof: ProfileScopeHandle<'life0>,
) -> Pin<Box<dyn Future<Output = Result<FullValue, VmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + Send + 'async_trait,
P: 'async_trait + VmPlugin<GlobalState = Self::GlobalState, LocalState = Self::LocalState>,
fn run<'life0, 'async_trait, P>(
this: Arc<RwLock<Self>>,
snippet: Workflow,
prof: ProfileScopeHandle<'life0>,
) -> Pin<Box<dyn Future<Output = Result<FullValue, VmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + Send + 'async_trait,
P: 'async_trait + VmPlugin<GlobalState = Self::GlobalState, LocalState = Self::LocalState>,
Runs the given workflow, possibly asynchronously (if a parallel is encountered / there are external functions calls and the given closure runs this asynchronously.) Read more
Auto Trait Implementations§
impl Freeze for OfflineVm
impl RefUnwindSafe for OfflineVm
impl Send for OfflineVm
impl Sync for OfflineVm
impl Unpin for OfflineVm
impl UnwindSafe for OfflineVm
Blanket Implementations§
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request