Enum distant_protocol::Request
source · pub enum Request {
Show 24 variants
FileRead {
path: PathBuf,
},
FileReadText {
path: PathBuf,
},
FileWrite {
path: PathBuf,
data: Vec<u8>,
},
FileWriteText {
path: PathBuf,
text: String,
},
FileAppend {
path: PathBuf,
data: Vec<u8>,
},
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,
},
SetPermissions {
path: PathBuf,
permissions: Permissions,
options: SetPermissionsOptions,
},
Search {
query: SearchQuery,
},
CancelSearch {
id: SearchId,
},
ProcSpawn {
cmd: Cmd,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>,
},
ProcKill {
id: ProcessId,
},
ProcStdin {
id: ProcessId,
data: Vec<u8>,
},
ProcResizePty {
id: ProcessId,
size: PtySize,
},
SystemInfo {},
Version {},
}
Expand description
Represents the payload of a request to be performed on the remote machine
Variants§
FileRead
Reads a file from the specified path on the remote machine
FileReadText
Reads a file from the specified path on the remote machine and treats the contents as text
FileWrite
Fields
Writes a file, creating it if it does not exist, and overwriting any existing content on the remote machine
FileWriteText
Fields
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
Appends to a file, creating it if it does not exist, on the remote machine
FileAppendText
Fields
Appends text to a file, creating it if it does not exist, on the remote machine
DirRead
Fields
depth: usize
Maximum depth to traverse with 0 indicating there is no maximum depth and 1 indicating the most immediate children within the directory
canonicalize: bool
Whether 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
Reads a directory from the specified path on the remote machine
DirCreate
Fields
Creates a directory on the remote machine
Remove
Fields
Removes a file or directory on the remote machine
Copy
Fields
Copies a file or directory on the remote machine
Rename
Fields
Moves/renames a file or directory on the remote machine
Watch
Fields
recursive: bool
If 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
Unwatches a path for changes, meaning no additional changes will be reported
Exists
Checks whether the given path exists
Metadata
Fields
Retrieves filesystem metadata for the specified path on the remote machine
SetPermissions
Fields
permissions: Permissions
New permissions to apply to the file, directory, or symlink
options: SetPermissionsOptions
Additional options to supply when setting permissions
Sets permissions on a file, directory, or symlink on the remote machine
Search
Fields
query: SearchQuery
Query to perform against the filesystem
Searches filesystem using the provided query
CancelSearch
Cancels an active search being run against the filesystem
ProcSpawn
Fields
environment: Environment
Environment to provide to the remote process
Spawns a new process on the remote machine
ProcKill
Kills a process running on the remote machine
ProcStdin
Fields
Sends additional data to stdin of running process
ProcResizePty
Fields
Resize pty of remote process
SystemInfo
Fields
Retrieve information about the server and the system it is on
Version
Fields
Retrieve information about the server’s protocol version