pub struct FakeRuntime { /* private fields */ }Expand description
An in-memory runtime used by tests and velos-tests. Exit can be simulated
with FakeRuntime::set_exited.
Implementations§
Source§impl FakeRuntime
impl FakeRuntime
pub fn new() -> Self
Sourcepub fn set_exited(&self, uid: &str, exit_code: i32) -> Result<(), RuntimeError>
pub fn set_exited(&self, uid: &str, exit_code: i32) -> Result<(), RuntimeError>
Simulate the instance for uid exiting with exit_code.
Trait Implementations§
Source§impl ContainerRuntime for FakeRuntime
impl ContainerRuntime for FakeRuntime
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 RunSpec,
) -> Pin<Box<dyn Future<Output = Result<InstanceId, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 RunSpec,
) -> Pin<Box<dyn Future<Output = Result<InstanceId, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Launch an instance tagged with
spec.uid. Idempotent callers check
list first.Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop the instance tagged with
uid (no-op if already gone).Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the instance tagged with
uid (no-op if already gone).Source§impl Default for FakeRuntime
impl Default for FakeRuntime
Source§fn default() -> FakeRuntime
fn default() -> FakeRuntime
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for FakeRuntime
impl RefUnwindSafe for FakeRuntime
impl Send for FakeRuntime
impl Sync for FakeRuntime
impl Unpin for FakeRuntime
impl UnsafeUnpin for FakeRuntime
impl UnwindSafe for FakeRuntime
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