[−][src]Struct wasi_common::virtfs::pipe::ReadPipe
A virtual pipe read end.
A variety of From
impls are provided so that common pipe types are easy to create. For example:
let mut ctx = WasiCtxBuilder::new(); let stdin = ReadPipe::from("hello from stdin!"); ctx.stdin(stdin);
Implementations
impl<R: Read + Any> ReadPipe<R>
[src]
pub fn new(r: R) -> Self
[src]
Create a new pipe from a Read
type.
All Handle
read operations delegate to reading from this underlying reader.
pub fn from_shared(reader: Arc<RwLock<R>>) -> Self
[src]
Create a new pipe from a shareable Read
type.
All Handle
read operations delegate to reading from this underlying reader.
pub fn try_into_inner(self) -> Result<R, Self>
[src]
Try to convert this ReadPipe<R>
back to the underlying R
type.
This will fail with Err(self)
if multiple references to the underlying R
exist.
Trait Implementations
impl<R: Read + Any> Clone for ReadPipe<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: Debug + Read + Any> Debug for ReadPipe<R>
[src]
impl<'_> From<&'_ [u8]> for ReadPipe<Cursor<Vec<u8>>>
[src]
impl<'_> From<&'_ str> for ReadPipe<Cursor<String>>
[src]
impl From<String> for ReadPipe<Cursor<String>>
[src]
impl From<Vec<u8>> for ReadPipe<Cursor<Vec<u8>>>
[src]
impl<R: Read + Any> Handle for ReadPipe<R>
[src]
fn as_any(&self) -> &dyn Any
[src]
fn try_clone(&self) -> Result<Box<dyn Handle>>
[src]
fn get_file_type(&self) -> Filetype
[src]
fn get_rights(&self) -> HandleRights
[src]
fn set_rights(&self, rights: HandleRights)
[src]
fn advise(
&self,
_advice: Advice,
_offset: Filesize,
_len: Filesize
) -> Result<()>
[src]
&self,
_advice: Advice,
_offset: Filesize,
_len: Filesize
) -> Result<()>
fn allocate(&self, _offset: Filesize, _len: Filesize) -> Result<()>
[src]
fn fdstat_set_flags(&self, _fdflags: Fdflags) -> Result<()>
[src]
fn filestat_get(&self) -> Result<Filestat>
[src]
fn filestat_set_size(&self, _st_size: Filesize) -> Result<()>
[src]
fn preadv(&self, buf: &mut [IoSliceMut], offset: Filesize) -> Result<usize>
[src]
fn seek(&self, _offset: SeekFrom) -> Result<Filesize>
[src]
fn read_vectored(&self, iovs: &mut [IoSliceMut]) -> Result<usize>
[src]
fn create_directory(&self, _path: &str) -> Result<()>
[src]
fn openat(
&self,
_path: &str,
_read: bool,
_write: bool,
_oflags: Oflags,
_fd_flags: Fdflags
) -> Result<Box<dyn Handle>>
[src]
&self,
_path: &str,
_read: bool,
_write: bool,
_oflags: Oflags,
_fd_flags: Fdflags
) -> Result<Box<dyn Handle>>
fn link(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle>,
_new_path: &str,
_follow: bool
) -> Result<()>
[src]
&self,
_old_path: &str,
_new_handle: Box<dyn Handle>,
_new_path: &str,
_follow: bool
) -> Result<()>
fn readlink(&self, _path: &str, _buf: &mut [u8]) -> Result<usize>
[src]
fn readlinkat(&self, _path: &str) -> Result<String>
[src]
fn rename(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle>,
_new_path: &str
) -> Result<()>
[src]
&self,
_old_path: &str,
_new_handle: Box<dyn Handle>,
_new_path: &str
) -> Result<()>
fn remove_directory(&self, _path: &str) -> Result<()>
[src]
fn symlink(&self, _old_path: &str, _new_path: &str) -> Result<()>
[src]
fn unlink_file(&self, _path: &str) -> Result<()>
[src]
fn is_directory(&self) -> bool
[src]
fn is_tty(&self) -> bool
[src]
fn datasync(&self) -> Result<()>
[src]
fn fdstat_get(&self) -> Result<Fdflags>
[src]
fn filestat_set_times(
&self,
_atim: Timestamp,
_mtim: Timestamp,
_fst_flags: Fstflags
) -> Result<()>
[src]
&self,
_atim: Timestamp,
_mtim: Timestamp,
_fst_flags: Fstflags
) -> Result<()>
fn pwritev(&self, _buf: &[IoSlice], _offset: u64) -> Result<usize>
[src]
fn readdir<'a>(
&'a self,
_cookie: Dircookie
) -> Result<Box<dyn Iterator<Item = Result<(Dirent, String)>> + 'a>>
[src]
&'a self,
_cookie: Dircookie
) -> Result<Box<dyn Iterator<Item = Result<(Dirent, String)>> + 'a>>
fn sync(&self) -> Result<()>
[src]
fn write_vectored(&self, _iovs: &[IoSlice]) -> Result<usize>
[src]
fn filestat_get_at(&self, _path: &str, _follow: bool) -> Result<Filestat>
[src]
fn filestat_set_times_at(
&self,
_path: &str,
_atim: Timestamp,
_mtim: Timestamp,
_fst_flags: Fstflags,
_follow: bool
) -> Result<()>
[src]
&self,
_path: &str,
_atim: Timestamp,
_mtim: Timestamp,
_fst_flags: Fstflags,
_follow: bool
) -> Result<()>
Auto Trait Implementations
impl<R> RefUnwindSafe for ReadPipe<R>
impl<R> Send for ReadPipe<R> where
R: Send + Sync,
R: Send + Sync,
impl<R> Sync for ReadPipe<R> where
R: Send + Sync,
R: Send + Sync,
impl<R> Unpin for ReadPipe<R>
impl<R> UnwindSafe for ReadPipe<R>
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,
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> Pointee for T
[src]
type Pointer = u32
fn debug(
pointer: <T as Pointee>::Pointer,
f: &mut Formatter
) -> Result<(), Error>
[src]
pointer: <T as Pointee>::Pointer,
f: &mut Formatter
) -> Result<(), Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,