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

Fields

§data: Vec<u8>

Binary data associated with the response

Response containing some arbitrary, binary data

§

Text

Fields

§data: String

Text data associated with the response

Response containing some arbitrary, text data

§

DirEntries

Fields

§entries: Vec<DirEntry>

Entries contained within the requested directory

§errors: Vec<Error>

Errors encountered while scanning for entries

Response to reading a directory

§

Changed(Change)

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

§

Exists

Fields

§value: bool

Response to checking if a path exists

§

Metadata(Metadata)

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

§

SearchStarted

Fields

§id: SearchId

Arbitrary id associated with search

Represents a search being started

§

SearchResults

Fields

§id: SearchId

Arbitrary id associated with search

§matches: Vec<SearchQueryMatch>

Collection of matches from performing a query

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

§

SearchDone

Fields

§id: SearchId

Arbitrary id associated with search

Represents a search being completed

§

ProcSpawned

Fields

§id: ProcessId

Arbitrary id associated with running process

Response to starting a new process

§

ProcStdout

Fields

§id: ProcessId

Arbitrary id associated with running process

§data: Vec<u8>

Data read from a process’ stdout pipe

Actively-transmitted stdout as part of running process

§

ProcStderr

Fields

§id: ProcessId

Arbitrary id associated with running process

§data: Vec<u8>

Data read from a process’ stderr pipe

Actively-transmitted stderr as part of running process

§

ProcDone

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

Response to a process finishing

§

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<Response> for Response

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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 StructuralEq for Response

source§

impl StructuralPartialEq for Response

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: for<'de> Deserialize<'de>,