TokioFileDescManagerEnv

Struct TokioFileDescManagerEnv 

Source
pub struct TokioFileDescManagerEnv { /* private fields */ }
Expand description

An environment implementation which manages opening, storing, and performing async I/O operations on file descriptor handles via tokio.

Implementations§

Source§

impl TokioFileDescManagerEnv

Source

pub fn new() -> Self

Create a new environment using specific opener/storer/async implementations.

Source

pub fn with_capacity(capacity: usize) -> Self

Constructs a new environment with no open file descriptors, but with a specified capacity for storing open file descriptors.

Source

pub fn with_process_stdio() -> Result<Self>

Constructs a new environment and initializes it with duplicated stdio file descriptors or handles of the current process.

Trait Implementations§

Source§

impl AsyncIoEnvironment for TokioFileDescManagerEnv

Source§

type IoHandle = Arc<FileDesc>

The underlying handle (e.g. FileDesc) with which to perform the async I/O.
Source§

fn read_all( &mut self, fd: Self::IoHandle, ) -> BoxFuture<'static, Result<Vec<u8>>>

Asynchronously read all data from the specified handle.
Source§

fn write_all<'a>( &mut self, fd: Self::IoHandle, data: Cow<'a, [u8]>, ) -> BoxFuture<'a, Result<()>>

Asynchronously write data into the specified handle.
Source§

fn write_all_best_effort(&mut self, fd: Self::IoHandle, data: Vec<u8>)

Asynchronously write the contents of data to a file handle in the background on a best effort basis (e.g. the implementation can give up due to any (appropriately) unforceen errors like broken pipes).
Source§

impl Clone for TokioFileDescManagerEnv

Source§

fn clone(&self) -> TokioFileDescManagerEnv

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TokioFileDescManagerEnv

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TokioFileDescManagerEnv

Source§

fn default() -> TokioFileDescManagerEnv

Returns the “default value” for a type. Read more
Source§

impl FileDescEnvironment for TokioFileDescManagerEnv

Source§

type FileHandle = Arc<FileDesc>

A file handle (or wrapper) to associate with shell file descriptors.
Source§

fn file_desc(&self, fd: Fd) -> Option<(&Self::FileHandle, Permissions)>

Get the permissions and a handle associated with an opened file descriptor.
Source§

fn set_file_desc( &mut self, fd: Fd, handle: Self::FileHandle, perms: Permissions, )

Associate a file descriptor with a given handle and permissions.
Source§

fn close_file_desc(&mut self, fd: Fd)

Treat the specified file descriptor as closed for the current environment.
Source§

impl FileDescOpener for TokioFileDescManagerEnv

Source§

type OpenedFileHandle = Arc<FileDesc>

A type which represents an opened file descriptor.
Source§

fn open_path( &mut self, path: &Path, opts: &OpenOptions, ) -> Result<Self::OpenedFileHandle>

Open a provided path with the specified OpenOptions.
Source§

fn open_pipe(&mut self) -> Result<Pipe<Self::OpenedFileHandle>>

Create a new Pipe pair.
Source§

impl SubEnvironment for TokioFileDescManagerEnv

Source§

fn sub_env(&self) -> Self

Create a new sub-environment, which starts out idential to its parent, but any changes on the new environment will not be reflected on the parent.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.