pub struct OsPipeReader { /* private fields */ }Expand description
Owned OS kernel pipe reader half behind a single use slot. Clone
shares the slot; take transfers the handle exactly once so no parent
copy survives spawn to starve the consumer of EOF. Backed by
std::io::pipe (stable since Rust 1.87): pipe on Unix, CreatePipe
on Windows.
Implementations§
Source§impl OsPipeReader
impl OsPipeReader
Sourcepub fn take(&self) -> Result<PipeReader>
pub fn take(&self) -> Result<PipeReader>
Take the handle for Stdio::from. Bails deterministically if the
descriptor was already consumed so a second spawn can never reuse a
spent pipe or leave stdio unbound.
Trait Implementations§
Source§impl Clone for OsPipeReader
impl Clone for OsPipeReader
Source§fn clone(&self) -> OsPipeReader
fn clone(&self) -> OsPipeReader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OsPipeReader
impl RefUnwindSafe for OsPipeReader
impl Send for OsPipeReader
impl Sync for OsPipeReader
impl Unpin for OsPipeReader
impl UnsafeUnpin for OsPipeReader
impl UnwindSafe for OsPipeReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more