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. Moved verbatim from oxdock-process so handle slots can
own kernel pairs without a dependency cycle; behavior is unchanged.
Implementations§
Source§impl OsPipeReader
impl OsPipeReader
Sourcepub fn take(&self) -> Result<PipeReader, Diagnostic>
pub fn take(&self) -> Result<PipeReader, Diagnostic>
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.
Sourcepub fn is_consumed(&self) -> bool
pub fn is_consumed(&self) -> bool
Whether this half was already taken. A poisoned slot reports live so callers never recycle what they cannot inspect.
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 Forget for OsPipeReader
impl Freeze for OsPipeReaderwhere
*const ArcInner<Mutex<Option<PipeReader>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<PipeReader>>>>: Freeze,
impl Move for OsPipeReader
impl RefUnwindSafe for OsPipeReader
impl Send for OsPipeReader
impl Sync for OsPipeReader
impl Unpin for OsPipeReader
impl UnsafeUnpin for OsPipeReaderwhere
*const ArcInner<Mutex<Option<PipeReader>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<PipeReader>>>>: UnsafeUnpin,
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