[−][src]Trait wasmer_wasi::WasiFile
This trait relies on your file closing when it goes out of scope via Drop
Required methods
pub fn last_accessed(&self) -> __wasi_timestamp_t
[src]
the last time the file was accessed in nanoseconds as a UNIX timestamp
pub fn last_modified(&self) -> __wasi_timestamp_t
[src]
the last time the file was modified in nanoseconds as a UNIX timestamp
pub fn created_time(&self) -> __wasi_timestamp_t
[src]
the time at which the file was created in nanoseconds as a UNIX timestamp
pub fn size(&self) -> u64
[src]
the size of the file in bytes
pub fn set_len(
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
[src]
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
Change the size of the file, if the new_size
is greater than the current size
the extra bytes will be allocated and zeroed
pub fn unlink(&mut self) -> Result<(), WasiFsError>
[src]
Request deletion of the file
pub fn bytes_available(&self) -> Result<usize, WasiFsError>
[src]
Returns the number of bytes available. This function must not block
Provided methods
pub fn set_last_accessed(&self, _last_accessed: __wasi_timestamp_t)
[src]
set the last time the file was accessed in nanoseconds as a UNIX timestamp
pub fn set_last_modified(&self, _last_modified: __wasi_timestamp_t)
[src]
set the last time the file was modified in nanoseconds as a UNIX timestamp
pub fn set_created_time(&self, _created_time: __wasi_timestamp_t)
[src]
set the time at which the file was created in nanoseconds as a UNIX timestamp
pub fn sync_to_disk(&self) -> Result<(), WasiFsError>
[src]
Store file contents and metadata to disk
Default implementation returns Ok(())
. You should implement this method if you care
about flushing your cache to permanent storage
pub fn rename_file(&self, _new_name: &Path) -> Result<(), WasiFsError>
[src]
Moves the file to a new location NOTE: the signature of this function will change before stabilization
pub fn get_raw_fd(&self) -> Option<i32>
[src]
Used for polling. Default returns None
because this method cannot be implemented for most types
Returns the underlying host fd
Implementations
impl dyn WasiFile + 'static
[src]
pub fn downcast_ref<T: 'static>(&self) -> Option<&T>
[src]
pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
[src]
Trait Implementations
impl<'typetag> Serialize for dyn WasiFile + 'typetag
[src]
impl<'typetag> Serialize for dyn WasiFile + Send + 'typetag
[src]
impl<'typetag> Serialize for dyn WasiFile + Sync + 'typetag
[src]
impl<'typetag> Serialize for dyn WasiFile + Send + Sync + 'typetag
[src]
impl Strictest for dyn WasiFile
[src]
Implementors
impl WasiFile for Pipe
[src]
pub fn last_accessed(&self) -> u64
[src]
pub fn last_modified(&self) -> u64
[src]
pub fn created_time(&self) -> u64
[src]
pub fn size(&self) -> u64
[src]
pub fn set_len(&mut self, len: u64) -> Result<(), WasiFsError>
[src]
pub fn unlink(&mut self) -> Result<(), WasiFsError>
[src]
pub fn bytes_available(&self) -> Result<usize, WasiFsError>
[src]
impl WasiFile for Stderr
[src]
pub fn last_accessed(&self) -> u64
[src]
pub fn last_modified(&self) -> u64
[src]
pub fn created_time(&self) -> u64
[src]
pub fn size(&self) -> u64
[src]
pub fn set_len(
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
[src]
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
pub fn unlink(&mut self) -> Result<(), WasiFsError>
[src]
pub fn bytes_available(&self) -> Result<usize, WasiFsError>
[src]
pub fn get_raw_fd(&self) -> Option<i32>
[src]
impl WasiFile for Stdin
[src]
pub fn last_accessed(&self) -> u64
[src]
pub fn last_modified(&self) -> u64
[src]
pub fn created_time(&self) -> u64
[src]
pub fn size(&self) -> u64
[src]
pub fn set_len(
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
[src]
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
pub fn unlink(&mut self) -> Result<(), WasiFsError>
[src]
pub fn bytes_available(&self) -> Result<usize, WasiFsError>
[src]
pub fn get_raw_fd(&self) -> Option<i32>
[src]
impl WasiFile for Stdout
[src]
pub fn last_accessed(&self) -> u64
[src]
pub fn last_modified(&self) -> u64
[src]
pub fn created_time(&self) -> u64
[src]
pub fn size(&self) -> u64
[src]
pub fn set_len(
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>
[src]
&mut self,
_new_size: __wasi_filesize_t
) -> Result<(), WasiFsError>