Struct openssh::Stdio

source ·
pub struct Stdio(/* private fields */);
Expand description

Describes what to do with a standard I/O stream for a remote child process when passed to the stdin, stdout, and stderr methods of Command.

Implementations§

source§

impl Stdio

source

pub const fn piped() -> Self

A new pipe should be arranged to connect the parent and remote child processes.

source

pub const fn null() -> Self

This stream will be ignored. This is the equivalent of attaching the stream to /dev/null.

source

pub const fn inherit() -> Self

The child inherits from the corresponding parent descriptor.

NOTE that the stdio fd must be in blocking mode, otherwise ssh might not flush all output since it considers (EAGAIN/EWOULDBLOCK) as an error

source

pub unsafe fn from_raw_fd_owned(fd: RawFd) -> Self

Stdio::from_raw_fd_owned takes ownership of the fd passed in and closes the fd on drop.

NOTE that the fd will be put into blocking mode, then it will be closed when Stdio is dropped.

§Safety
  • fd - must be a valid fd and must give its ownership to Stdio.

Trait Implementations§

source§

impl Debug for Stdio

source§

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

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

impl From<ChildStderr> for Stdio

source§

fn from(arg: ChildStderr) -> Self

Converts to this type from the input type.
source§

impl From<ChildStderr> for Stdio

source§

fn from(arg: ChildStderr) -> Self

Converts to this type from the input type.
source§

impl From<ChildStdin> for Stdio

source§

fn from(arg: ChildStdin) -> Self

Converts to this type from the input type.
source§

impl From<ChildStdin> for Stdio

source§

fn from(arg: ChildStdin) -> Self

Converts to this type from the input type.
source§

impl From<ChildStdout> for Stdio

source§

fn from(arg: ChildStdout) -> Self

Converts to this type from the input type.
source§

impl From<ChildStdout> for Stdio

source§

fn from(arg: ChildStdout) -> Self

Converts to this type from the input type.
source§

impl From<File> for Stdio

source§

fn from(arg: File) -> Self

Converts to this type from the input type.
source§

impl From<OwnedFd> for Stdio

source§

fn from(fd: OwnedFd) -> Self

Converts to this type from the input type.
source§

impl From<PipeRead> for Stdio

Deprecated, use From<OwnedFd> for Stdio or Stdio::from_raw_fd_owned instead.

source§

fn from(arg: PipeRead) -> Self

Converts to this type from the input type.
source§

impl From<PipeWrite> for Stdio

Deprecated, use From<OwnedFd> for Stdio or Stdio::from_raw_fd_owned instead.

source§

fn from(arg: PipeWrite) -> Self

Converts to this type from the input type.
source§

impl From<Stdio> for Stdio

source§

fn from(stdio: Stdio) -> Self

Converts to this type from the input type.
source§

impl FromRawFd for Stdio

Deprecated, use Stdio::from_raw_fd_owned instead.

FromRawFd takes ownership of the fd passed in and closes the fd on drop.

NOTE that the fd must be in blocking mode, otherwise ssh might not flush all output since it considers (EAGAIN/EWOULDBLOCK) as an error

source§

unsafe fn from_raw_fd(fd: RawFd) -> Self

Constructs a new instance of Self from the given raw file descriptor. Read more
source§

impl TryFrom<ChildStderr> for Stdio

§

type Error = Error

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

fn try_from(arg: ChildStderr) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ChildStdin> for Stdio

§

type Error = Error

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

fn try_from(arg: ChildStdin) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ChildStdout> for Stdio

§

type Error = Error

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

fn try_from(arg: ChildStdout) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Stdio

§

impl RefUnwindSafe for Stdio

§

impl Send for Stdio

§

impl Sync for Stdio

§

impl Unpin for Stdio

§

impl UnwindSafe for Stdio

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.