pub struct Filesystem { /* private fields */ }Expand description
Filesystem helper for a sandbox data-plane session.
Implementations§
Source§impl Filesystem
impl Filesystem
Sourcepub async fn read_bytes_with_options(
&self,
path: &str,
opts: FileReadOptions,
) -> Result<Vec<u8>>
pub async fn read_bytes_with_options( &self, path: &str, opts: FileReadOptions, ) -> Result<Vec<u8>>
Read a file as raw bytes with an optional SDK-side byte cap.
Sourcepub async fn write(
&self,
path: &str,
data: impl AsRef<[u8]>,
) -> Result<WriteInfo>
pub async fn write( &self, path: &str, data: impl AsRef<[u8]>, ) -> Result<WriteInfo>
Write bytes or text to a file.
Sourcepub async fn write_files(
&self,
files: Vec<WriteEntry>,
) -> Result<Vec<WriteInfo>>
pub async fn write_files( &self, files: Vec<WriteEntry>, ) -> Result<Vec<WriteInfo>>
Write several files in one runtime API call.
Sourcepub async fn list(&self, path: &str) -> Result<Vec<EntryInfo>>
pub async fn list(&self, path: &str) -> Result<Vec<EntryInfo>>
List directory entries below path.
Sourcepub async fn exists(&self, path: &str) -> Result<bool>
pub async fn exists(&self, path: &str) -> Result<bool>
Return whether a file or directory exists at path.
Sourcepub async fn rename(&self, old_path: &str, new_path: &str) -> Result<EntryInfo>
pub async fn rename(&self, old_path: &str, new_path: &str) -> Result<EntryInfo>
Move or rename a file.
Sourcepub async fn watch_dir(
&self,
path: &str,
opts: WatchOptions,
) -> Result<WatchHandle>
pub async fn watch_dir( &self, path: &str, opts: WatchOptions, ) -> Result<WatchHandle>
Start watching a directory for filesystem events.
Trait Implementations§
Source§impl Clone for Filesystem
impl Clone for Filesystem
Source§fn clone(&self) -> Filesystem
fn clone(&self) -> Filesystem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Filesystem
impl !UnwindSafe for Filesystem
impl Freeze for Filesystem
impl Send for Filesystem
impl Sync for Filesystem
impl Unpin for Filesystem
impl UnsafeUnpin for Filesystem
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