Struct wasmtime_wasi::virtfs::VirtualDir
source · [−]pub struct VirtualDir { /* private fields */ }
Expand description
A clonable read/write directory.
Implementations
sourceimpl VirtualDir
impl VirtualDir
pub fn new(writable: bool) -> VirtualDir
pub fn with_dir<P>(self, dir: VirtualDir, path: P) -> VirtualDir where
P: AsRef<Path>,
pub fn add_dir<P>(&mut self, dir: VirtualDir, path: P) where
P: AsRef<Path>,
pub fn with_file<P>(
self,
content: Box<dyn FileContents + 'static, Global>,
path: P
) -> VirtualDir where
P: AsRef<Path>,
pub fn add_file<P>(
&mut self,
content: Box<dyn FileContents + 'static, Global>,
path: P
) where
P: AsRef<Path>,
Trait Implementations
sourceimpl Handle for VirtualDir
impl Handle for VirtualDir
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 filestat_get(&self) -> Result<Filestat, Error>
pub fn readdir(
&self,
cookie: u64
) -> Result<Box<dyn Iterator<Item = Result<(Dirent, String), Error>> + 'static, Global>, Error>
pub fn create_directory(&self, path: &str) -> Result<(), Error>
pub fn filestat_get_at(
&self,
path: &str,
_follow: bool
) -> Result<Filestat, Error>
pub fn filestat_set_times_at(
&self,
path: &str,
atim: u64,
mtim: u64,
fst_flags: Fstflags,
_follow: bool
) -> 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 readlinkat(&self, _path: &str) -> Result<String, Error>
pub fn remove_directory(&self, 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 advise(&self, _advice: Advice, _offset: u64, _len: u64) -> Result<(), Error>
fn allocate(&self, _offset: u64, _len: u64) -> Result<(), Error>
fn datasync(&self) -> Result<(), Error>
fn fdstat_get(&self) -> Result<Fdflags, Error>
fn fdstat_set_flags(&self, _fdflags: Fdflags) -> Result<(), Error>
fn filestat_set_size(&self, _st_size: u64) -> Result<(), Error>
fn filestat_set_times(
&self,
_atim: u64,
_mtim: u64,
_fst_flags: Fstflags
) -> Result<(), Error>
fn preadv(
&self,
_buf: &mut [IoSliceMut<'_>],
_offset: u64
) -> Result<usize, Error>
fn pwritev(&self, _buf: &[IoSlice<'_>], _offset: u64) -> Result<usize, Error>
fn read_vectored(&self, _iovs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn seek(&self, _offset: SeekFrom) -> Result<u64, Error>
fn sync(&self) -> Result<(), Error>
fn write_vectored(&self, _iovs: &[IoSlice<'_>]) -> Result<usize, Error>
fn link(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle + 'static, Global>,
_new_path: &str,
_follow: bool
) -> Result<(), Error>
fn readlink(&self, _path: &str, _buf: &mut [u8]) -> Result<usize, Error>
fn rename(
&self,
_old_path: &str,
_new_handle: Box<dyn Handle + 'static, Global>,
_new_path: &str
) -> Result<(), Error>
fn symlink(&self, _old_path: &str, _new_path: &str) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for VirtualDir
impl !Send for VirtualDir
impl !Sync for VirtualDir
impl Unpin for VirtualDir
impl !UnwindSafe for VirtualDir
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