[−][src]Struct wasi_common::OsFile
A file backed by the operating system's file system. Dereferences to a
RawOsHandle
. Its impl of Handle
uses Rust's std
to implement all
file descriptor operations.
Constructing OsFile
OsFile
can currently only be constructed from std::fs::File
using
the std::convert::TryFrom
trait:
use std::fs::OpenOptions; use std::convert::TryFrom; use wasi_common::OsFile; let file = OpenOptions::new().read(true).open("some_file").unwrap(); let os_file = OsFile::try_from(file).unwrap();
Trait Implementations
impl Debug for OsFile
[src]
impl Deref for OsFile
[src]
type Target = RawOsHandle
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl Handle for OsFile
[src]
pub fn as_any(&self) -> &dyn Any
[src]
pub fn try_clone(&self) -> Result<Box<dyn Handle>>
[src]
pub fn get_file_type(&self) -> Filetype
[src]
pub fn get_rights(&self) -> HandleRights
[src]
pub fn set_rights(&self, rights: HandleRights)
[src]
pub fn advise(
&self,
advice: Advice,
offset: Filesize,
len: Filesize
) -> Result<()>
[src]
&self,
advice: Advice,
offset: Filesize,
len: Filesize
) -> Result<()>
pub fn allocate(&self, offset: Filesize, len: Filesize) -> Result<()>
[src]
pub fn datasync(&self) -> Result<()>
[src]
pub fn fdstat_get(&self) -> Result<Fdflags>
[src]
pub fn fdstat_set_flags(&self, fdflags: Fdflags) -> Result<()>
[src]
pub fn filestat_get(&self) -> Result<Filestat>
[src]
pub fn filestat_set_size(&self, size: Filesize) -> Result<()>
[src]
pub fn filestat_set_times(
&self,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> Result<()>
[src]
&self,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> Result<()>
pub fn preadv(&self, buf: &mut [IoSliceMut<'_>], offset: u64) -> Result<usize>
[src]
pub fn pwritev(&self, buf: &[IoSlice<'_>], offset: u64) -> Result<usize>
[src]
pub fn read_vectored(&self, iovs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
pub fn seek(&self, offset: SeekFrom) -> Result<u64>
[src]
pub fn sync(&self) -> Result<()>
[src]
pub fn write_vectored(&self, iovs: &[IoSlice<'_>]) -> Result<usize>
[src]
pub fn is_directory(&self) -> bool
[src]
pub fn is_tty(&self) -> bool
[src]
pub 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>>
pub fn create_directory(&self, _path: &str) -> Result<()>
[src]
pub fn filestat_get_at(&self, _path: &str, _follow: bool) -> Result<Filestat>
[src]
pub 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<()>
pub 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>>
pub 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<()>
pub fn readlink(&self, _path: &str, _buf: &mut [u8]) -> Result<usize>
[src]
pub fn readlinkat(&self, _path: &str) -> Result<String>
[src]
pub fn remove_directory(&self, _path: &str) -> Result<()>
[src]
pub 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<()>
pub fn symlink(&self, _old_path: &str, _new_path: &str) -> Result<()>
[src]
pub fn unlink_file(&self, _path: &str) -> Result<()>
[src]
impl TryFrom<File> for OsFile
[src]
Auto Trait Implementations
impl !RefUnwindSafe for OsFile
[src]
impl Send for OsFile
[src]
impl !Sync for OsFile
[src]
impl Unpin for OsFile
[src]
impl UnwindSafe for OsFile
[src]
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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
pub 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, 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>,