pub struct SmolRuntime(/* private fields */);Available on crate feature
smol-runtime only.Expand description
The Runtime implementation backed by the “async-*” family of crates.
Implementations§
Source§impl SmolRuntime
impl SmolRuntime
Sourcepub fn with_executor<E: Into<Arc<Executor<'static>>>>(executor: E) -> Self
pub fn with_executor<E: Into<Arc<Executor<'static>>>>(executor: E) -> Self
Create a SmolRuntime from a potentially Arced statically lifetimed async_executor::Executor, not taking advantage of async_executor::StaticExecutor optimizations.
Sourcepub fn with_static_executor(executor: &'static StaticExecutor) -> Self
pub fn with_static_executor(executor: &'static StaticExecutor) -> Self
Create a SmolRuntime from a static reference to an optimized async_executor::StaticExecutor.
Trait Implementations§
Source§impl Clone for SmolRuntime
impl Clone for SmolRuntime
Source§fn clone(&self) -> SmolRuntime
fn clone(&self) -> SmolRuntime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Runtime for SmolRuntime
impl Runtime for SmolRuntime
Source§type Task<O: Send + 'static> = SmolRuntimeTask<O>
type Task<O: Send + 'static> = SmolRuntimeTask<O>
The RuntimeTask implementation used by this Runtime.
Source§type TimeoutError = TimeoutError
type TimeoutError = TimeoutError
The error this Runtime yields when a future times out in a controlled manner.
Source§type File = File
type File = File
The I/O object representing an opened asynchronously readable file within this Runtime.
Source§type AsyncFd = SmolRuntimeAsyncFd
type AsyncFd = SmolRuntimeAsyncFd
The RuntimeAsyncFd implementation used by this Runtime.
Source§type Child = SmolRuntimeChild
type Child = SmolRuntimeChild
The RuntimeChild implementation used by this Runtime.
Source§type SocketBackend = AsyncIoBackend
type SocketBackend = AsyncIoBackend
Available on crate feature
vmm-process only.The hyper_client_sockets::Backend of this Runtime, used by fctools to establish connections over
Unix or Firecracker sockets.
Source§fn spawn_task<F>(&self, future: F) -> Self::Task<F::Output>
fn spawn_task<F>(&self, future: F) -> Self::Task<F::Output>
Source§fn timeout<F>(
&self,
duration: Duration,
future: F,
) -> impl Future<Output = Result<F::Output, Self::TimeoutError>> + Send
fn timeout<F>( &self, duration: Duration, future: F, ) -> impl Future<Output = Result<F::Output, Self::TimeoutError>> + Send
Source§fn fs_exists(
&self,
path: &Path,
) -> impl Future<Output = Result<bool, Error>> + Send
fn fs_exists( &self, path: &Path, ) -> impl Future<Output = Result<bool, Error>> + Send
Check if the given Path exists on the filesystem.
Source§fn fs_remove_file(
&self,
path: &Path,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_remove_file( &self, path: &Path, ) -> impl Future<Output = Result<(), Error>> + Send
Remove the given Path as a file from the filesystem.
Source§fn fs_create_dir_all(
&self,
path: &Path,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_create_dir_all( &self, path: &Path, ) -> impl Future<Output = Result<(), Error>> + Send
Recursively create a directory tree at the given Path on the filesystem.
Source§async fn fs_create_file(&self, path: &Path) -> Result<(), Error>
async fn fs_create_file(&self, path: &Path) -> Result<(), Error>
Create a file at the given Path on the filesystem.
Source§fn fs_write(
&self,
path: &Path,
content: String,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_write( &self, path: &Path, content: String, ) -> impl Future<Output = Result<(), Error>> + Send
Source§fn fs_read_to_string(
&self,
path: &Path,
) -> impl Future<Output = Result<String, Error>> + Send
fn fs_read_to_string( &self, path: &Path, ) -> impl Future<Output = Result<String, Error>> + Send
Source§fn fs_rename(
&self,
source_path: &Path,
destination_path: &Path,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_rename( &self, source_path: &Path, destination_path: &Path, ) -> impl Future<Output = Result<(), Error>> + Send
Source§fn fs_remove_dir_all(
&self,
path: &Path,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_remove_dir_all( &self, path: &Path, ) -> impl Future<Output = Result<(), Error>> + Send
Recursively remove the directory and its contents at the given Path on the filesystem.
Source§fn fs_chown_all(
&self,
path: &Path,
uid: u32,
gid: u32,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_chown_all( &self, path: &Path, uid: u32, gid: u32, ) -> impl Future<Output = Result<(), Error>> + Send
Recursively change the ownership of the given Path on the filesystem to the given PAM UID and GID.
Source§fn fs_hard_link(
&self,
source_path: &Path,
destination_path: &Path,
) -> impl Future<Output = Result<(), Error>> + Send
fn fs_hard_link( &self, source_path: &Path, destination_path: &Path, ) -> impl Future<Output = Result<(), Error>> + Send
Source§fn fs_open_file_for_read(
&self,
path: &Path,
) -> impl Future<Output = Result<Self::File, Error>> + Send
fn fs_open_file_for_read( &self, path: &Path, ) -> impl Future<Output = Result<Self::File, Error>> + Send
Open the file at the given Path on the filesystem in read-only mode, returning an I/O object used for
asynchronously reading its contents.
Source§fn spawn_process(
&self,
program: &OsStr,
args: &[OsString],
stdout: bool,
stderr: bool,
stdin: bool,
) -> Result<Self::Child, Error>
fn spawn_process( &self, program: &OsStr, args: &[OsString], stdout: bool, stderr: bool, stdin: bool, ) -> Result<Self::Child, Error>
Spawn a child process asynchronously on this Runtime, using the given program, arguments and flags determining
whether the stdout, stderr and stdin pipes are nulled or piped.
Source§fn run_process(
&self,
program: &OsStr,
args: &[OsString],
stdout: bool,
stderr: bool,
) -> impl Future<Output = Result<Output, Error>> + Send
fn run_process( &self, program: &OsStr, args: &[OsString], stdout: bool, stderr: bool, ) -> impl Future<Output = Result<Output, Error>> + Send
Run a child process asynchronously on this Runtime until completion, using the given program, arguments and flags
determining whether the stdout and stderr pipes are nulled or piped.
Auto Trait Implementations§
impl Freeze for SmolRuntime
impl RefUnwindSafe for SmolRuntime
impl Send for SmolRuntime
impl Sync for SmolRuntime
impl Unpin for SmolRuntime
impl UnwindSafe for SmolRuntime
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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