Enum distant_core::data::DistantRequestData
source · [−]pub enum DistantRequestData {
Show 20 variants
FileRead {
path: PathBuf,
},
FileReadText {
path: PathBuf,
},
FileWrite {
path: PathBuf,
data: ByteVec,
},
FileWriteText {
path: PathBuf,
text: String,
},
FileAppend {
path: PathBuf,
data: ByteVec,
},
FileAppendText {
path: PathBuf,
text: String,
},
DirRead {
path: PathBuf,
depth: usize,
absolute: bool,
canonicalize: bool,
include_root: bool,
},
DirCreate {
path: PathBuf,
all: bool,
},
Remove {
path: PathBuf,
force: bool,
},
Copy {
src: PathBuf,
dst: PathBuf,
},
Rename {
src: PathBuf,
dst: PathBuf,
},
Watch {
path: PathBuf,
recursive: bool,
only: Vec<ChangeKind>,
except: Vec<ChangeKind>,
},
Unwatch {
path: PathBuf,
},
Exists {
path: PathBuf,
},
Metadata {
path: PathBuf,
canonicalize: bool,
resolve_file_type: bool,
},
ProcSpawn {
cmd: Cmd,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>,
},
ProcKill {
id: ProcessId,
},
ProcStdin {
id: ProcessId,
data: Vec<u8>,
},
ProcResizePty {
id: ProcessId,
size: PtySize,
},
SystemInfo {},
}Expand description
Represents the payload of a request to be performed on the remote machine
Variants
FileRead
Fields
path: PathBufThe path to the file on the remote machine
Reads a file from the specified path on the remote machine
FileReadText
Fields
path: PathBufThe path to the file on the remote machine
Reads a file from the specified path on the remote machine and treats the contents as text
FileWrite
Fields
path: PathBufThe path to the file on the remote machine
data: ByteVecData for server-side writing of content
Writes a file, creating it if it does not exist, and overwriting any existing content on the remote machine
FileWriteText
Fields
path: PathBufThe path to the file on the remote machine
text: StringData for server-side writing of content
Writes a file using text instead of bytes, creating it if it does not exist, and overwriting any existing content on the remote machine
FileAppend
Fields
path: PathBufThe path to the file on the remote machine
data: ByteVecData for server-side writing of content
Appends to a file, creating it if it does not exist, on the remote machine
FileAppendText
Fields
path: PathBufThe path to the file on the remote machine
text: StringData for server-side writing of content
Appends text to a file, creating it if it does not exist, on the remote machine
DirRead
Fields
path: PathBufThe path to the directory on the remote machine
depth: usizeMaximum depth to traverse with 0 indicating there is no maximum depth and 1 indicating the most immediate children within the directory
absolute: boolWhether or not to return absolute or relative paths
canonicalize: boolWhether or not to canonicalize the resulting paths, meaning returning the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved
Note that the flag absolute must be true to have absolute paths returned, even if canonicalize is flagged as true
include_root: boolWhether or not to include the root directory in the retrieved entries
If included, the root directory will also be a canonicalized, absolute path and will not follow any of the other flags
Reads a directory from the specified path on the remote machine
DirCreate
Fields
path: PathBufThe path to the directory on the remote machine
all: boolWhether or not to create all parent directories
Creates a directory on the remote machine
Remove
Fields
path: PathBufThe path to the file or directory on the remote machine
force: boolWhether or not to remove all contents within directory if is a directory. Does nothing different for files
Removes a file or directory on the remote machine
Copy
Fields
src: PathBufThe path to the file or directory on the remote machine
dst: PathBufNew location on the remote machine for copy of file or directory
Copies a file or directory on the remote machine
Rename
Fields
src: PathBufThe path to the file or directory on the remote machine
dst: PathBufNew location on the remote machine for the file or directory
Moves/renames a file or directory on the remote machine
Watch
Fields
path: PathBufThe path to the file, directory, or symlink on the remote machine
recursive: boolIf true, will recursively watch for changes within directories, othewise will only watch for changes immediately within directories
only: Vec<ChangeKind>Filter to only report back specified changes
except: Vec<ChangeKind>Filter to report back changes except these specified changes
Watches a path for changes
Unwatch
Fields
path: PathBufThe path to the file, directory, or symlink on the remote machine
Unwatches a path for changes, meaning no additional changes will be reported
Exists
Fields
path: PathBufThe path to the file or directory on the remote machine
Checks whether the given path exists
Metadata
Fields
path: PathBufThe path to the file, directory, or symlink on the remote machine
canonicalize: boolWhether or not to include a canonicalized version of the path, meaning returning the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved
resolve_file_type: boolWhether or not to follow symlinks to determine absolute file type (dir/file)
Retrieves filesystem metadata for the specified path on the remote machine
ProcSpawn
Fields
cmd: CmdThe full command to run including arguments
environment: EnvironmentEnvironment to provide to the remote process
persist: boolWhether or not the process should be persistent, meaning that the process will not be killed when the associated client disconnects
Spawns a new process on the remote machine
ProcKill
Fields
id: ProcessIdId of the actively-running process
Kills a process running on the remote machine
ProcStdin
Fields
id: ProcessIdId of the actively-running process to send stdin data
Sends additional data to stdin of running process
ProcResizePty
Fields
id: ProcessIdId of the actively-running process whose pty to resize
size: PtySizeThe new pty dimensions
Resize pty of remote process
SystemInfo
Fields
Retrieve information about the server and the system it is on
Implementations
sourceimpl DistantRequestData
impl DistantRequestData
pub fn is_file_read(&self) -> bool
pub fn is_file_read_text(&self) -> bool
pub fn is_file_write(&self) -> bool
pub fn is_file_write_text(&self) -> bool
pub fn is_file_append(&self) -> bool
pub fn is_file_append_text(&self) -> bool
pub fn is_dir_read(&self) -> bool
pub fn is_dir_create(&self) -> bool
pub fn is_remove(&self) -> bool
pub fn is_copy(&self) -> bool
pub fn is_rename(&self) -> bool
pub fn is_watch(&self) -> bool
pub fn is_unwatch(&self) -> bool
pub fn is_exists(&self) -> bool
pub fn is_metadata(&self) -> bool
pub fn is_proc_spawn(&self) -> bool
pub fn is_proc_kill(&self) -> bool
pub fn is_proc_stdin(&self) -> bool
pub fn is_proc_resize_pty(&self) -> bool
pub fn is_system_info(&self) -> bool
Trait Implementations
sourceimpl Clone for DistantRequestData
impl Clone for DistantRequestData
sourcefn clone(&self) -> DistantRequestData
fn clone(&self) -> DistantRequestData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DistantRequestData
impl Debug for DistantRequestData
sourceimpl<'de> Deserialize<'de> for DistantRequestData
impl<'de> Deserialize<'de> for DistantRequestData
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<DistantRequestData> for DistantRequestData
impl PartialEq<DistantRequestData> for DistantRequestData
sourcefn eq(&self, other: &DistantRequestData) -> bool
fn eq(&self, other: &DistantRequestData) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DistantRequestData) -> bool
fn ne(&self, other: &DistantRequestData) -> bool
This method tests for !=.
sourceimpl Serialize for DistantRequestData
impl Serialize for DistantRequestData
impl Eq for DistantRequestData
impl StructuralEq for DistantRequestData
impl StructuralPartialEq for DistantRequestData
Auto Trait Implementations
impl RefUnwindSafe for DistantRequestData
impl Send for DistantRequestData
impl Sync for DistantRequestData
impl Unpin for DistantRequestData
impl UnwindSafe for DistantRequestData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more