pub enum RequestData {
Show 21 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: String, args: Vec<String>, persist: bool, pty: Option<PtySize>, }, ProcKill { id: usize, }, ProcStdin { id: usize, data: Vec<u8>, }, ProcResizePty { id: usize, size: PtySize, }, ProcList {}, SystemInfo {},
}
Expand description

Represents the payload of a request to be performed on the remote machine

Variants

FileRead

Fields

path: PathBuf

The path to the file on the remote machine

Reads a file from the specified path on the remote machine

FileReadText

Fields

path: PathBuf

The 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: PathBuf

The path to the file on the remote machine

data: ByteVec

Data 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: PathBuf

The path to the file on the remote machine

text: String

Data 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: PathBuf

The path to the file on the remote machine

data: ByteVec

Data for server-side writing of content

Appends to a file, creating it if it does not exist, on the remote machine

FileAppendText

Fields

path: PathBuf

The path to the file on the remote machine

text: String

Data 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: PathBuf

The path to the directory on the remote machine

depth: usize

Maximum depth to traverse with 0 indicating there is no maximum depth and 1 indicating the most immediate children within the directory

absolute: bool

Whether or not to return absolute or relative paths

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

include_root: bool

Whether 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: PathBuf

The path to the directory on the remote machine

all: bool

Whether or not to create all parent directories

Creates a directory on the remote machine

Remove

Fields

path: PathBuf

The path to the file or directory on the remote machine

force: bool

Whether 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: PathBuf

The path to the file or directory on the remote machine

dst: PathBuf

New location on the remote machine for copy of file or directory

Copies a file or directory on the remote machine

Rename

Fields

src: PathBuf

The path to the file or directory on the remote machine

dst: PathBuf

New location on the remote machine for the file or directory

Moves/renames a file or directory on the remote machine

Watch

Fields

path: PathBuf

The path to the file, directory, or symlink on the remote machine

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

Fields

path: PathBuf

The 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: PathBuf

The path to the file or directory on the remote machine

Checks whether the given path exists

Metadata

Fields

path: PathBuf

The path to the file, directory, or symlink on the remote machine

canonicalize: bool

Whether 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: bool

Whether 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: String

Name of the command to run

args: Vec<String>

Arguments for the command

persist: bool

Whether or not the process should be persistent, meaning that the process will not be killed when the associated client disconnects

pty: Option<PtySize>

If provided, will spawn process in a pty, otherwise spawns directly

Spawns a new process on the remote machine

ProcKill

Fields

id: usize

Id of the actively-running process

Kills a process running on the remote machine

ProcStdin

Fields

id: usize

Id of the actively-running process to send stdin data

data: Vec<u8>

Data to send to a process’s stdin pipe

Sends additional data to stdin of running process

ProcResizePty

Fields

id: usize

Id of the actively-running process whose pty to resize

size: PtySize

The new pty dimensions

Resize pty of remote process

ProcList

Fields

Retrieve a list of all processes being managed by the remote server

SystemInfo

Fields

Retrieve information about the server and the system it is on

Implementations

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.