[−][src]Trait wasmer_wasi::state::WasiFile
This trait relies on your file closing when it goes out of scope via Drop
Required methods
fn last_accessed(&self) -> __wasi_timestamp_t
the last time the file was accessed in nanoseconds as a UNIX timestamp
fn last_modified(&self) -> __wasi_timestamp_t
the last time the file was modified in nanoseconds as a UNIX timestamp
fn created_time(&self) -> __wasi_timestamp_t
the time at which the file was created in nanoseconds as a UNIX timestamp
fn size(&self) -> u64
the size of the file in bytes
Provided methods
fn set_last_accessed(&self, _last_accessed: __wasi_timestamp_t)
set the last time the file was accessed in nanoseconds as a UNIX timestamp
fn set_last_modified(&self, _last_modified: __wasi_timestamp_t)
set the last time the file was modified in nanoseconds as a UNIX timestamp
fn set_created_time(&self, _created_time: __wasi_timestamp_t)
set the time at which the file was created in nanoseconds as a UNIX timestamp
fn set_len(&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
fn unlink(&mut self) -> Result<(), WasiFsError>
Request deletion of the file
fn sync_to_disk(&self) -> Result<(), WasiFsError>
Store file contents and metadata to disk
fn rename_file(&self, _new_name: &Path) -> Result<(), WasiFsError>
Moves the file to a new location NOTE: the signature of this function will change before stabilization
fn bytes_available(&self) -> Result<usize, WasiFsError>
Returns the number of bytes available. This function must not block
fn get_raw_fd(&self) -> Option<i32>
Used for polling. Default returns None
because this method cannot be implemented for most types
Returns the underlying host fd