Struct wasmtime_wasi::virtfs::InMemoryFile
source · [−]pub struct InMemoryFile { /* private fields */ }
Expand description
An InMemoryFile
is a shared handle to some underlying data. The relationship is analagous to
a filesystem wherein a file descriptor is one view into a possibly-shared underlying collection
of data and permissions on a filesystem.
Implementations
sourceimpl InMemoryFile
impl InMemoryFile
pub fn memory_backed() -> InMemoryFile
pub fn new(contents: Box<dyn FileContents + 'static, Global>) -> InMemoryFile
Trait Implementations
sourceimpl Handle for InMemoryFile
impl Handle for InMemoryFile
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn try_clone(&self) -> Result<Box<dyn Handle + 'static, Global>, Error>
pub fn get_file_type(&self) -> Filetype
pub fn get_rights(&self) -> HandleRights
pub fn set_rights(&self, rights: HandleRights)
pub fn advise(
&self,
_advice: Advice,
_offset: u64,
_len: u64
) -> Result<(), Error>
pub fn allocate(&self, offset: u64, len: u64) -> Result<(), Error>
pub fn fdstat_get(&self) -> Result<Fdflags, Error>
pub fn fdstat_set_flags(&self, fdflags: Fdflags) -> Result<(), Error>
pub fn filestat_get(&self) -> Result<Filestat, Error>
pub fn filestat_set_size(&self, st_size: u64) -> Result<(), Error>
pub fn preadv(
&self,
buf: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize, Error>
pub fn pwritev(&self, buf: &[IoSlice<'_>], offset: u64) -> Result<usize, Error>
pub fn read_vectored(&self, iovs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
pub fn seek(&self, offset: SeekFrom) -> Result<u64, Error>
pub fn write_vectored(&self, iovs: &[IoSlice<'_>]) -> Result<usize, Error>
pub fn create_directory(&self, _path: &str) -> Result<(), Error>
pub fn openat(
&self,
path: &str,
_read: bool,
_write: bool,
oflags: Oflags,
_fd_flags: Fdflags
) -> Result<Box<dyn Handle + 'static, Global>, Error>
pub fn link(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle + 'static, Global>,
_new_path: &str,
_follow: bool
) -> Result<(), Error>
pub fn readlink(&self, _path: &str, _buf: &mut [u8]) -> Result<usize, Error>
pub fn readlinkat(&self, _path: &str) -> Result<String, Error>
pub fn rename(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle + 'static, Global>,
_new_path: &str
) -> Result<(), Error>
pub fn remove_directory(&self, _path: &str) -> Result<(), Error>
pub fn symlink(&self, _old_path: &str, _new_path: &str) -> Result<(), Error>
pub fn unlink_file(&self, _path: &str) -> Result<(), Error>
fn is_directory(&self) -> bool
sourcefn is_tty(&self) -> bool
fn is_tty(&self) -> bool
Test whether this descriptor is considered a tty within WASI.
Note that since WASI itself lacks an isatty
syscall and relies
on a conservative approximation, we use the same approximation here. Read more
fn datasync(&self) -> Result<(), Error>
fn filestat_set_times(
&self,
_atim: u64,
_mtim: u64,
_fst_flags: Fstflags
) -> Result<(), Error>
fn readdir(
&'a self,
_cookie: u64
) -> Result<Box<dyn Iterator<Item = Result<(Dirent, String), Error>> + 'a, Global>, Error>
fn sync(&self) -> Result<(), Error>
fn filestat_get_at(&self, _path: &str, _follow: bool) -> Result<Filestat, Error>
fn filestat_set_times_at(
&self,
_path: &str,
_atim: u64,
_mtim: u64,
_fst_flags: Fstflags,
_follow: bool
) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for InMemoryFile
impl !Send for InMemoryFile
impl !Sync for InMemoryFile
impl Unpin for InMemoryFile
impl !UnwindSafe for InMemoryFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more