pub struct Pipe { /* private fields */ }Expand description
Shared pipe handle.
Implementations§
Source§impl Pipe
impl Pipe
Sourcepub fn read(&self, buf: &mut [u8]) -> Result<usize, SyscallError>
pub fn read(&self, buf: &mut [u8]) -> Result<usize, SyscallError>
Read from the pipe. Returns 0 on EOF (write end closed + empty).
Sourcepub fn write(&self, buf: &[u8]) -> Result<usize, SyscallError>
pub fn write(&self, buf: &[u8]) -> Result<usize, SyscallError>
Write to the pipe. Returns EPIPE if read end is closed.
Sourcepub fn close_read(&self) -> bool
pub fn close_read(&self) -> bool
Decrement the read-end refcount; marks the end closed only when it reaches zero. Returns true if the end was actually closed.
Sourcepub fn close_write(&self) -> bool
pub fn close_write(&self) -> bool
Decrement the write-end refcount; marks the end closed only when it reaches zero. Returns true if the end was actually closed.
Auto Trait Implementations§
impl !Freeze for Pipe
impl !RefUnwindSafe for Pipe
impl Send for Pipe
impl Sync for Pipe
impl Unpin for Pipe
impl UnsafeUnpin for Pipe
impl UnwindSafe for Pipe
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more