Struct conch_runtime::env::RedirectRestorer [] [src]

pub struct RedirectRestorer<E: ?Sized> where
    E: FileDescEnvironment
{ /* fields omitted */ }

Maintains a state of all file descriptors that have been modified so that they can be restored later.

Note: the caller should take care that a restorer instance is always called with the same environment for its entire lifetime. Using different environments with the same restorer instance will undoubtedly do the wrong thing eventually, and no guarantees can be made.

Methods

impl<E: ?Sized> RedirectRestorer<E> where
    E: FileDescEnvironment
[src]

[src]

Create a new wrapper.

[src]

Create a new wrapper and reserve capacity for backing up the previous file descriptors of the environment.

[src]

Deprecated

: use the RedirectEnvRestorer trait instead

Reserves capacity for at least additional more redirects to be backed up.

[src]

Deprecated

: use the RedirectEnvRestorer trait instead

Applies changes to a given environment after backing up as appropriate.

[src]

Deprecated

: use the RedirectEnvRestorer trait instead

Backs up the original handle of specified file descriptor.

The original value of the file descriptor is the one the environment held before it was passed into this wrapper. That is, if a file descriptor is backed up multiple times, only the value before the first call could be restored later.

[src]

Deprecated

: use the RedirectEnvRestorer trait instead

Restore all file descriptors to their original state.

Trait Implementations

impl<E: Clone + ?Sized> Clone for RedirectRestorer<E> where
    E: FileDescEnvironment,
    E::FileHandle: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<E: ?Sized> Eq for RedirectRestorer<E> where
    E: FileDescEnvironment,
    E::FileHandle: Eq
[src]

impl<E: ?Sized> PartialEq<Self> for RedirectRestorer<E> where
    E: FileDescEnvironment,
    E::FileHandle: PartialEq
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<E: ?Sized> Debug for RedirectRestorer<E> where
    E: FileDescEnvironment,
    E::FileHandle: Debug
[src]

[src]

Formats the value using the given formatter.

impl<E: ?Sized> Default for RedirectRestorer<E> where
    E: FileDescEnvironment
[src]

[src]

Returns the "default value" for a type. Read more

impl<E: ?Sized> RedirectEnvRestorer<E> for RedirectRestorer<E> where
    E: FileDescEnvironment,
    E::FileHandle: Clone
[src]

[src]

Reserves capacity for at least additional more redirects to be backed up.

[src]

Applies changes to a given environment after backing up as appropriate.

[src]

Backs up the original handle of specified file descriptor. Read more

[src]

Restore all file descriptors to their original state.