Movatterモバイル変換


[0]ホーム

URL:


ChildStdout

std::process

StructChildStdout 

1.0.0 ·Source
pub struct ChildStdout {/* private fields */ }
Expand description

A handle to a child process’s standard output (stdout).

This struct is used in thestdout field onChild.

When an instance ofChildStdout isdropped, theChildStdout’sunderlying file handle will be closed.

Trait Implementations§

1.63.0 ·Source§

implAsFd forChildStdout

Available onUnix only.
Source§

fnas_fd(&self) ->BorrowedFd<'_>

Available onUnix or HermitCore ortarget_os=trusty or WASI ortarget_os=motor only.
Borrows the file descriptor.Read more
1.63.0 ·Source§

implAsHandle forChildStdout

Available onWindows only.
Source§

fnas_handle(&self) ->BorrowedHandle<'_>

Borrows the handle.Read more
1.2.0 ·Source§

implAsRawFd forChildStdout

Available onUnix only.
Source§

fnas_raw_fd(&self) ->RawFd

Available onUnix or HermitCore ortarget_os=trusty or WASI ortarget_os=motor only.
Extracts the raw file descriptor.Read more
1.2.0 ·Source§

implAsRawHandle forChildStdout

Available onWindows only.
Source§

fnas_raw_handle(&self) ->RawHandle

Extracts the raw handle.Read more
1.16.0 ·Source§

implDebug forChildStdout

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

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

implFrom<ChildStdout> forOwnedFd

Available onUnix only.
Source§

fnfrom(child_stdout:ChildStdout) ->OwnedFd

Takes ownership of aChildStdout’s file descriptor.

1.63.0 ·Source§

implFrom<ChildStdout> forOwnedHandle

Available onWindows only.
Source§

fnfrom(child_stdout:ChildStdout) ->OwnedHandle

Takes ownership of aChildStdout’s file handle.

1.20.0 ·Source§

implFrom<ChildStdout> forStdio

Source§

fnfrom(child:ChildStdout) ->Stdio

Converts aChildStdout into aStdio.

§Examples

ChildStdout will be converted toStdio usingStdio::from under the hood.

usestd::process::{Command, Stdio};lethello = Command::new("echo")    .arg("Hello, world!")    .stdout(Stdio::piped())    .spawn()    .expect("failed echo command");letreverse = Command::new("rev")    .stdin(hello.stdout.unwrap())// Converted into a Stdio here.output()    .expect("failed reverse command");assert_eq!(reverse.stdout,b"!dlrow ,olleH\n");
1.74.0 ·Source§

implFrom<OwnedFd> forChildStdout

Available onUnix only.

Creates aChildStdout from the providedOwnedFd.

The provided file descriptor must point to a pipewith theCLOEXEC flag set.

Source§

fnfrom(fd:OwnedFd) ->ChildStdout

Converts to this type from the input type.
1.74.0 ·Source§

implFrom<OwnedHandle> forChildStdout

Available onWindows only.

Creates aChildStdout from the providedOwnedHandle.

The provided handle must be asynchronous, as reading andwriting from and to it is implemented using asynchronous APIs.

Source§

fnfrom(handle:OwnedHandle) ->ChildStdout

Converts to this type from the input type.
1.4.0 ·Source§

implIntoRawFd forChildStdout

Available onUnix only.
Source§

fninto_raw_fd(self) ->RawFd

Available onUnix or HermitCore ortarget_os=trusty or WASI ortarget_os=motor only.
Consumes this object, returning the raw underlying file descriptor.Read more
1.4.0 ·Source§

implIntoRawHandle forChildStdout

Available onWindows only.
Source§

fninto_raw_handle(self) ->RawHandle

Consumes this object, returning the raw underlying handle.Read more
1.0.0 ·Source§

implRead forChildStdout

Source§

fnread(&mut self, buf: &mut [u8]) ->Result<usize>

Pull some bytes from this source into the specified buffer, returninghow many bytes were read.Read more
Source§

fnread_buf(&mut self, buf:BorrowedCursor<'_>) ->Result<()>

🔬This is a nightly-only experimental API. (read_buf #78485)
Pull some bytes from this source into the specified buffer.Read more
Source§

fnread_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) ->Result<usize>

Likeread, except that it reads into a slice of buffers.Read more
Source§

fnis_read_vectored(&self) ->bool

🔬This is a nightly-only experimental API. (can_vector #69941)
Determines if thisReader has an efficientread_vectoredimplementation.Read more
Source§

fnread_to_end(&mut self, buf: &mutVec<u8>) ->Result<usize>

Reads all bytes until EOF in this source, placing them intobuf.Read more
1.0.0 ·Source§

fnread_to_string(&mut self, buf: &mutString) ->Result<usize>

Reads all bytes until EOF in this source, appending them tobuf.Read more
1.6.0 ·Source§

fnread_exact(&mut self, buf: &mut [u8]) ->Result<()>

Reads the exact number of bytes required to fillbuf.Read more
Source§

fnread_buf_exact(&mut self, cursor:BorrowedCursor<'_>) ->Result<()>

🔬This is a nightly-only experimental API. (read_buf #78485)
Reads the exact number of bytes required to fillcursor.Read more
1.0.0 ·Source§

fnby_ref(&mut self) -> &mut Self
where Self:Sized,

Creates a “by reference” adapter for this instance ofRead.Read more
1.0.0 ·Source§

fnbytes(self) ->Bytes<Self>
where Self:Sized,

Transforms thisRead instance to anIterator over its bytes.Read more
1.0.0 ·Source§

fnchain<R:Read>(self, next: R) ->Chain<Self, R>
where Self:Sized,

Creates an adapter which will chain this stream with another.Read more
1.0.0 ·Source§

fntake(self, limit:u64) ->Take<Self>
where Self:Sized,

Creates an adapter which will read at mostlimit bytes from it.Read more
Source§

fnread_array<const N:usize>(&mut self) ->Result<[u8;N]>
where Self:Sized,

🔬This is a nightly-only experimental API. (read_array #148848)
Read and return a fixed array of bytes from this source.Read more

Auto Trait Implementations§

§

implFreeze forChildStdout

§

implRefUnwindSafe forChildStdout

§

implSend forChildStdout

§

implSync forChildStdout

§

implUnpin forChildStdout

§

implUnwindSafe forChildStdout

Blanket Implementations§

Source§

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

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

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

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

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

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fninto(self) -> U

CallsU::from(self).

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

Source§

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

Source§

typeError =Infallible

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

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

typeError = <U asTryFrom<T>>::Error

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

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.

[8]ページ先頭

©2009-2026 Movatter.jp