Struct ipipe::Pipe [−][src]
Abstraction over a named pipe
Implementations
impl Pipe[src]
pub fn open(path: &Path, _: OnCleanup) -> Result<Self>[src]
Open a pipe at an existing path. Note that this function is not platform-agnostic as unix pipe paths and Windows pipe paths are are formatted differnetly.
pub fn with_name(name: &str) -> Result<Self>[src]
Open a pipe with the given name. Note that this is just a string name, not a path.
pub fn create() -> Result<Self>[src]
Open a pipe with a randomly generated name.
pub fn close(&mut self) -> Result<()>[src]
Close the pipe. If the pipe is not closed before deallocation, this will be called automatically on drop.
pub fn write_byte(&mut self, buf: u8) -> Result<usize>[src]
Write a single byte to the pipe
pub fn write_bytes(&mut self, buf: &[u8]) -> Result<usize>[src]
Write an array of bytes to the pipe
pub fn write_string(&mut self, s: &str) -> Result<usize>[src]
Writes a string to the pipe
pub fn read_byte(&mut self) -> Result<u8>[src]
Read a single byte
pub fn read_bytes(&mut self, size: usize) -> Result<Vec<u8>>[src]
Reads the given number of bytes and returns the result in a vector.
pub fn read_string(&mut self, size: usize) -> Result<String>[src]
Reads the given number of bytes and returns the result as a string.
pub fn flush_pipe(&mut self) -> Result<()>[src]
Flush input and output.
impl Pipe[src]
pub fn path(&self) -> &Path[src]
Return the path to this named pipe
pub fn iter(&mut self) -> FifoIterator<'_>ⓘNotable traits for FifoIterator<'_>
impl Iterator for FifoIterator<'_> type Item = u8;[src]
Notable traits for FifoIterator<'_>
impl Iterator for FifoIterator<'_> type Item = u8;Creates an iterator that reads bytes until the pipe is closed.
pub fn read_bytes_while(
&mut self,
predicate: impl Fn(u8) -> bool
) -> Result<Vec<u8>>[src]
&mut self,
predicate: impl Fn(u8) -> bool
) -> Result<Vec<u8>>
Reads until the given predicate is false, and returns the result as a vector of bytes.
pub fn read_string_while(
&mut self,
predicate: impl Fn(u8) -> bool
) -> Result<String>[src]
&mut self,
predicate: impl Fn(u8) -> bool
) -> Result<String>
Reads until the given predicate is false, and returns the result as a string.
Trait Implementations
impl Clone for Pipe[src]
fn clone(&self) -> Self[src]
Cloning a pipe creates a slave which points to the same path but does not close the pipe when dropped.
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Drop for Pipe[src]
impl Read for Pipe[src]
fn read(&mut self, bytes: &mut [u8]) -> Result<usize>[src]
pub fn read_vectored(
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>1.36.0[src]
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>
pub fn is_read_vectored(&self) -> bool[src]
pub unsafe fn initializer(&self) -> Initializer[src]
pub fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>1.0.0[src]
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>1.0.0[src]
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>1.6.0[src]
pub fn by_ref(&mut self) -> &mut Self1.0.0[src]
pub fn bytes(self) -> Bytes<Self>1.0.0[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read, 1.0.0[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>1.0.0[src]
impl Send for Pipe[src]
impl Sync for Pipe[src]
impl Write for Pipe[src]
fn write(&mut self, bytes: &[u8]) -> Result<usize>[src]
fn flush(&mut self) -> Result<()>[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>1.36.0[src]
pub fn is_write_vectored(&self) -> bool[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self1.0.0[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,