pub struct FileManager<'a> { /* private fields */ }Expand description
File manager for sandbox file operations
Implementations§
Source§impl<'a> FileManager<'a>
impl<'a> FileManager<'a>
Sourcepub fn new(client: &'a DaytonaClient) -> Self
pub fn new(client: &'a DaytonaClient) -> Self
Create a new file manager
Sourcepub async fn upload(
&self,
sandbox_id: &Uuid,
path: &str,
content: &[u8],
) -> Result<()>
pub async fn upload( &self, sandbox_id: &Uuid, path: &str, content: &[u8], ) -> Result<()>
Upload a file to the sandbox
Sourcepub async fn upload_text(
&self,
sandbox_id: &Uuid,
path: &str,
content: &str,
) -> Result<()>
pub async fn upload_text( &self, sandbox_id: &Uuid, path: &str, content: &str, ) -> Result<()>
Upload text content as a file
Sourcepub async fn download(&self, sandbox_id: &Uuid, path: &str) -> Result<Vec<u8>>
pub async fn download(&self, sandbox_id: &Uuid, path: &str) -> Result<Vec<u8>>
Download a file from the sandbox
Sourcepub async fn download_text(
&self,
sandbox_id: &Uuid,
path: &str,
) -> Result<String>
pub async fn download_text( &self, sandbox_id: &Uuid, path: &str, ) -> Result<String>
Download a text file from the sandbox
Sourcepub async fn delete(&self, sandbox_id: &Uuid, path: &str) -> Result<()>
pub async fn delete(&self, sandbox_id: &Uuid, path: &str) -> Result<()>
Delete a file from the sandbox
Sourcepub async fn list(&self, sandbox_id: &Uuid, path: &str) -> Result<Vec<FileInfo>>
pub async fn list(&self, sandbox_id: &Uuid, path: &str) -> Result<Vec<FileInfo>>
List files in a directory
Sourcepub async fn get_file_info(
&self,
sandbox_id: &Uuid,
path: &str,
) -> Result<FileInfo>
pub async fn get_file_info( &self, sandbox_id: &Uuid, path: &str, ) -> Result<FileInfo>
Get file information
Sourcepub async fn exists(&self, sandbox_id: &Uuid, path: &str) -> Result<bool>
pub async fn exists(&self, sandbox_id: &Uuid, path: &str) -> Result<bool>
Check if a file exists
Sourcepub async fn create_directory(
&self,
sandbox_id: &Uuid,
path: &str,
) -> Result<()>
pub async fn create_directory( &self, sandbox_id: &Uuid, path: &str, ) -> Result<()>
Create a directory
Sourcepub async fn copy(
&self,
sandbox_id: &Uuid,
source: &str,
destination: &str,
) -> Result<()>
pub async fn copy( &self, sandbox_id: &Uuid, source: &str, destination: &str, ) -> Result<()>
Copy a file within the sandbox
Sourcepub async fn rename(
&self,
sandbox_id: &Uuid,
source: &str,
destination: &str,
) -> Result<()>
pub async fn rename( &self, sandbox_id: &Uuid, source: &str, destination: &str, ) -> Result<()>
Move/rename a file within the sandbox
Sourcepub async fn find_in_files(
&self,
sandbox_id: &Uuid,
pattern: &str,
path: &str,
) -> Result<Vec<FindResult>>
pub async fn find_in_files( &self, sandbox_id: &Uuid, pattern: &str, path: &str, ) -> Result<Vec<FindResult>>
Find text in files
Sourcepub async fn replace_in_files(
&self,
sandbox_id: &Uuid,
find: &str,
replace: &str,
files: &[String],
) -> Result<Vec<String>>
pub async fn replace_in_files( &self, sandbox_id: &Uuid, find: &str, replace: &str, files: &[String], ) -> Result<Vec<String>>
Replace text in files
Auto Trait Implementations§
impl<'a> Freeze for FileManager<'a>
impl<'a> !RefUnwindSafe for FileManager<'a>
impl<'a> Send for FileManager<'a>
impl<'a> Sync for FileManager<'a>
impl<'a> Unpin for FileManager<'a>
impl<'a> !UnwindSafe for FileManager<'a>
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