FileDescManagerEnv

Struct FileDescManagerEnv 

Source
pub struct FileDescManagerEnv<O, S, A> { /* private fields */ }
Expand description

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

Implementations§

Source§

impl<O, S, A> FileDescManagerEnv<O, S, A>

Source

pub fn new(opener: O, storer: S, async_env: A) -> Self

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

Trait Implementations§

Source§

impl<O, S, A> AsyncIoEnvironment for FileDescManagerEnv<O, S, A>

Source§

type IoHandle = <A as AsyncIoEnvironment>::IoHandle

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<O: Clone, S: Clone, A: Clone> Clone for FileDescManagerEnv<O, S, A>

Source§

fn clone(&self) -> FileDescManagerEnv<O, S, A>

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<O: Debug, S: Debug, A: Debug> Debug for FileDescManagerEnv<O, S, A>

Source§

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

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

impl<O: Default, S: Default, A: Default> Default for FileDescManagerEnv<O, S, A>

Source§

fn default() -> FileDescManagerEnv<O, S, A>

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

impl<O, S, A> FileDescEnvironment for FileDescManagerEnv<O, S, A>

Source§

type FileHandle = <S as FileDescEnvironment>::FileHandle

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<O, S, A> FileDescOpener for FileDescManagerEnv<O, S, A>

Source§

type OpenedFileHandle = <A as AsyncIoEnvironment>::IoHandle

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<O: PartialEq, S: PartialEq, A: PartialEq> PartialEq for FileDescManagerEnv<O, S, A>

Source§

fn eq(&self, other: &FileDescManagerEnv<O, S, A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<O, S, A> SubEnvironment for FileDescManagerEnv<O, S, A>

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.
Source§

impl<O: Eq, S: Eq, A: Eq> Eq for FileDescManagerEnv<O, S, A>

Source§

impl<O, S, A> StructuralPartialEq for FileDescManagerEnv<O, S, A>

Auto Trait Implementations§

§

impl<O, S, A> Freeze for FileDescManagerEnv<O, S, A>
where O: Freeze, S: Freeze, A: Freeze,

§

impl<O, S, A> RefUnwindSafe for FileDescManagerEnv<O, S, A>

§

impl<O, S, A> Send for FileDescManagerEnv<O, S, A>
where O: Send, S: Send, A: Send,

§

impl<O, S, A> Sync for FileDescManagerEnv<O, S, A>
where O: Sync, S: Sync, A: Sync,

§

impl<O, S, A> Unpin for FileDescManagerEnv<O, S, A>
where O: Unpin, S: Unpin, A: Unpin,

§

impl<O, S, A> UnwindSafe for FileDescManagerEnv<O, S, A>
where O: UnwindSafe, S: UnwindSafe, A: UnwindSafe,

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.
Source§

impl<T> FileDescManagerEnvironment for T