Enum 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

Fields

§path: PathBuf

The path to the file on the remote machine

§

FileReadText

Reads a file from the specified path on the remote machine and treats the contents as text

Fields

§path: PathBuf

The path to the file on the remote machine

§

FileWrite

Writes a file, creating it if it does not exist, and overwriting any existing content on the remote machine

Fields

§path: PathBuf

The path to the file on the remote machine

§data: Vec<u8>

Data for server-side writing of content

§

FileWriteText

Writes a file using text instead of bytes, creating it if it does not exist, and overwriting any existing content on the remote machine

Fields

§path: PathBuf

The path to the file on the remote machine

§text: String

Data for server-side writing of content

§

FileAppend

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

Fields

§path: PathBuf

The path to the file on the remote machine

§data: Vec<u8>

Data for server-side writing of content

§

FileAppendText

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

Fields

§path: PathBuf

The path to the file on the remote machine

§text: String

Data for server-side writing of content

§

DirRead

Reads a directory from the specified path on the remote machine

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

§

DirCreate

Creates a directory on the remote machine

Fields

§path: PathBuf

The path to the directory on the remote machine

§all: bool

Whether or not to create all parent directories

§

Remove

Removes a file or directory on the remote machine

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

§

Copy

Copies a file or directory on the remote machine

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

§

Rename

Moves/renames a file or directory on the remote machine

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

§

Watch

Watches a path for changes

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

§

Unwatch

Unwatches a path for changes, meaning no additional changes will be reported

Fields

§path: PathBuf

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

§

Exists

Checks whether the given path exists

Fields

§path: PathBuf

The path to the file or directory on the remote machine

§

Metadata

Retrieves filesystem metadata for the specified path on the remote machine

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)

§

SetPermissions

Sets permissions on a file, directory, or symlink on the remote machine

Fields

§path: PathBuf

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

§permissions: Permissions

New permissions to apply to the file, directory, or symlink

§options: SetPermissionsOptions

Additional options to supply when setting permissions

§

Search

Searches filesystem using the provided query

Fields

§query: SearchQuery

Query to perform against the filesystem

§

CancelSearch

Cancels an active search being run against the filesystem

Fields

§id: SearchId

Id of the search to cancel

§

ProcSpawn

Spawns a new process on the remote machine

Fields

§cmd: Cmd

The full command to run including arguments

§environment: Environment

Environment to provide to the remote process

§current_dir: Option<PathBuf>

Alternative current directory for the remote process

§pty: Option<PtySize>

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

§

ProcKill

Kills a process running on the remote machine

Fields

§id: ProcessId

Id of the actively-running process

§

ProcStdin

Sends additional data to stdin of running process

Fields

§id: ProcessId

Id of the actively-running process to send stdin data

§data: Vec<u8>

Data to send to a process’s stdin pipe

§

ProcResizePty

Resize pty of remote process

Fields

§id: ProcessId

Id of the actively-running process whose pty to resize

§size: PtySize

The new pty dimensions

§

SystemInfo

Retrieve information about the server and the system it is on

§

Version

Retrieve information about the server’s protocol version

Implementations§

Source§

impl Request

Source

pub fn is_file_read(&self) -> bool

Source

pub fn is_file_read_text(&self) -> bool

Source

pub fn is_file_write(&self) -> bool

Source

pub fn is_file_write_text(&self) -> bool

Source

pub fn is_file_append(&self) -> bool

Source

pub fn is_file_append_text(&self) -> bool

Source

pub fn is_dir_read(&self) -> bool

Source

pub fn is_dir_create(&self) -> bool

Source

pub fn is_remove(&self) -> bool

Source

pub fn is_copy(&self) -> bool

Source

pub fn is_rename(&self) -> bool

Source

pub fn is_watch(&self) -> bool

Source

pub fn is_unwatch(&self) -> bool

Source

pub fn is_exists(&self) -> bool

Source

pub fn is_metadata(&self) -> bool

Source

pub fn is_set_permissions(&self) -> bool

Source

pub fn is_proc_spawn(&self) -> bool

Source

pub fn is_proc_kill(&self) -> bool

Source

pub fn is_proc_stdin(&self) -> bool

Source

pub fn is_proc_resize_pty(&self) -> bool

Source

pub fn is_system_info(&self) -> bool

Source

pub fn is_version(&self) -> bool

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Request

Source§

fn eq(&self, other: &Request) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Request

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Request

Source§

impl StructuralPartialEq for Request

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,