pub struct RemoteConnection { /* private fields */ }Implementations§
Source§impl RemoteConnection
impl RemoteConnection
pub fn get_default_key_files() -> Result<(PathBuf, PathBuf)>
Sourcepub fn canonicalize_key_path(path: &str) -> Result<PathBuf>
pub fn canonicalize_key_path(path: &str) -> Result<PathBuf>
Canonicalize a key path, handling both absolute and relative paths
pub async fn new(connection_info: RemoteConnectionInfo) -> Result<Self>
pub async fn separator(&self) -> Result<char>
pub async fn canonicalize(&self, path: &str) -> Result<String>
Sourcepub fn get_ssh_prefix(&self) -> Result<String>
pub fn get_ssh_prefix(&self) -> Result<String>
Get the SSH connection string in the format user@host: or user@host#port: Uses # as port separator to distinguish from path separators in SSH URLs
pub async fn read_file(&self, path: &str) -> Result<Vec<u8>>
pub async fn read_file_to_string(&self, path: &str) -> Result<String>
pub async fn write_file(&self, path: &str, data: &[u8]) -> Result<()>
pub async fn create_file(&self, path: &str, data: &[u8]) -> Result<()>
pub async fn create_directories(&self, path: &str) -> Result<()>
pub async fn list_directory(&self, path: &str) -> Result<Vec<String>>
Sourcepub async fn list_directory_with_types(
&self,
path: &str,
) -> Result<Vec<(String, bool)>>
pub async fn list_directory_with_types( &self, path: &str, ) -> Result<Vec<(String, bool)>>
List directory with file type information (more efficient for tree generation)
pub async fn is_file(&self, path: &str) -> bool
pub async fn is_directory(&self, path: &str) -> bool
pub async fn exists(&self, path: &str) -> bool
pub async fn file_size(&self, path: &str) -> Result<u64>
pub async fn rename(&self, old_path: &str, new_path: &str) -> Result<()>
pub async fn execute_command_unified( &self, command: &str, options: CommandOptions, cancel_rx: &mut Receiver<()>, progress_callback: Option<impl Fn(String) + Send + Sync + 'static>, ctx: Option<&RequestContext<RoleServer>>, ) -> Result<(String, i32)>
pub async fn execute_command( &self, command: &str, timeout: Option<Duration>, ctx: Option<&RequestContext<RoleServer>>, ) -> Result<(String, i32)>
pub async fn execute_command_with_streaming<F>( &self, command: &str, timeout: Option<Duration>, cancel_rx: &mut Receiver<()>, progress_callback: F, ) -> Result<(String, i32)>
pub fn connection_string(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RemoteConnection
impl !RefUnwindSafe for RemoteConnection
impl Send for RemoteConnection
impl Sync for RemoteConnection
impl Unpin for RemoteConnection
impl !UnwindSafe for RemoteConnection
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