pub struct Files { /* private fields */ }Expand description
File-system surface, obtained via crate::Sandbox::files.
Implementations§
Source§impl Files
impl Files
Sourcepub async fn read(
&self,
file_path: &str,
options: FileOptions,
) -> Result<Vec<u8>, HeyoError>
pub async fn read( &self, file_path: &str, options: FileOptions, ) -> Result<Vec<u8>, HeyoError>
Read the file at file_path (relative to the mount). Returns the
raw bytes — use read_text for UTF-8 convenience.
Sourcepub async fn read_text(
&self,
file_path: &str,
options: FileOptions,
) -> Result<String, HeyoError>
pub async fn read_text( &self, file_path: &str, options: FileOptions, ) -> Result<String, HeyoError>
Convenience wrapper around read that decodes the bytes as UTF-8.
Sourcepub async fn write(
&self,
file_path: &str,
content: impl Into<FileContent>,
options: FileOptions,
) -> Result<(), HeyoError>
pub async fn write( &self, file_path: &str, content: impl Into<FileContent>, options: FileOptions, ) -> Result<(), HeyoError>
Write content to file_path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Files
impl !UnwindSafe for Files
impl Freeze for Files
impl Send for Files
impl Sync for Files
impl Unpin for Files
impl UnsafeUnpin for Files
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more