Enum Response

Source
pub enum Response {
Show 17 variants Ok, Error(Error), Blob { data: Vec<u8>, }, Text { data: String, }, DirEntries { entries: Vec<DirEntry>, errors: Vec<Error>, }, Changed(Change), Exists { value: bool, }, Metadata(Metadata), SearchStarted { id: SearchId, }, SearchResults { id: SearchId, matches: Vec<SearchQueryMatch>, }, SearchDone { id: SearchId, }, ProcSpawned { id: ProcessId, }, ProcStdout { id: ProcessId, data: Vec<u8>, }, ProcStderr { id: ProcessId, data: Vec<u8>, }, ProcDone { id: ProcessId, success: bool, code: Option<i32>, }, SystemInfo(SystemInfo), Version(Version),
}
Expand description

Represents the payload of a successful response

Variants§

§

Ok

General okay with no extra data, returned in cases like creating or removing a directory, copying a file, or renaming a file

§

Error(Error)

General-purpose failure that occurred from some request

§

Blob

Response containing some arbitrary, binary data

Fields

§data: Vec<u8>

Binary data associated with the response

§

Text

Response containing some arbitrary, text data

Fields

§data: String

Text data associated with the response

§

DirEntries

Response to reading a directory

Fields

§entries: Vec<DirEntry>

Entries contained within the requested directory

§errors: Vec<Error>

Errors encountered while scanning for entries

§

Changed(Change)

Response to a filesystem change for some watched file, directory, or symlink

§

Exists

Response to checking if a path exists

Fields

§value: bool
§

Metadata(Metadata)

Represents metadata about some filesystem object (file, directory, symlink) on remote machine

§

SearchStarted

Represents a search being started

Fields

§id: SearchId

Arbitrary id associated with search

§

SearchResults

Represents some subset of results for a search query (may not be all of them)

Fields

§id: SearchId

Arbitrary id associated with search

§matches: Vec<SearchQueryMatch>

Collection of matches from performing a query

§

SearchDone

Represents a search being completed

Fields

§id: SearchId

Arbitrary id associated with search

§

ProcSpawned

Response to starting a new process

Fields

§id: ProcessId

Arbitrary id associated with running process

§

ProcStdout

Actively-transmitted stdout as part of running process

Fields

§id: ProcessId

Arbitrary id associated with running process

§data: Vec<u8>

Data read from a process’ stdout pipe

§

ProcStderr

Actively-transmitted stderr as part of running process

Fields

§id: ProcessId

Arbitrary id associated with running process

§data: Vec<u8>

Data read from a process’ stderr pipe

§

ProcDone

Response to a process finishing

Fields

§id: ProcessId

Arbitrary id associated with running process

§success: bool

Whether or not termination was successful

§code: Option<i32>

Exit code associated with termination, will be missing if terminated by signal

§

SystemInfo(SystemInfo)

Response to retrieving information about the server and the system it is on

§

Version(Version)

Response to retrieving information about the server’s version

Implementations§

Source§

impl Response

Source

pub fn is_ok(&self) -> bool

Source

pub fn is_error(&self) -> bool

Source

pub fn is_blob(&self) -> bool

Source

pub fn is_text(&self) -> bool

Source

pub fn is_dir_entries(&self) -> bool

Source

pub fn is_changed(&self) -> bool

Source

pub fn is_exists(&self) -> bool

Source

pub fn is_metadata(&self) -> bool

Source

pub fn is_search_started(&self) -> bool

Source

pub fn is_search_results(&self) -> bool

Source

pub fn is_search_done(&self) -> bool

Source

pub fn is_proc_spawned(&self) -> bool

Source

pub fn is_proc_stdout(&self) -> bool

Source

pub fn is_proc_stderr(&self) -> bool

Source

pub fn is_proc_done(&self) -> bool

Source

pub fn is_system_info(&self) -> bool

Source

pub fn is_version(&self) -> bool

Trait Implementations§

Source§

impl AsRef<str> for Response

Source§

fn as_ref(&self) -> &str

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

impl Clone for Response

Source§

fn clone(&self) -> Response

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 Response

Source§

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

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

impl<'de> Deserialize<'de> for Response

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<'_enum> From<&'_enum Response> for ResponseKind

Source§

fn from(val: &'_enum Response) -> ResponseKind

Converts to this type from the input type.
Source§

impl From<Error> for Response

Source§

fn from(x: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Response> for ResponseKind

Source§

fn from(val: Response) -> ResponseKind

Converts to this type from the input type.
Source§

impl PartialEq for Response

Source§

fn eq(&self, other: &Response) -> 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 Response

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 Response

Source§

impl StructuralPartialEq for Response

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>,