Enum distant_core::data::ResponseData[][src]

pub enum ResponseData {
Show 13 variants Ok, Error(Error), Blob { data: Vec<u8>, }, Text { data: String, }, DirEntries { entries: Vec<DirEntry>, errors: Vec<Error>, }, Exists(bool), Metadata { canonicalized_path: Option<PathBuf>, file_type: FileType, len: u64, readonly: bool, accessed: Option<u128>, created: Option<u128>, modified: Option<u128>, }, ProcStart { id: usize, }, ProcStdout { id: usize, data: String, }, ProcStderr { id: usize, data: String, }, ProcDone { id: usize, success: bool, code: Option<i32>, }, ProcEntries { entries: Vec<RunningProcess>, }, SystemInfo { family: String, os: String, arch: String, current_dir: PathBuf, main_separator: char, },
}
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

Tuple Fields of Error

0: Error
Blob

Response containing some arbitrary, binary data

Fields of Blob

data: Vec<u8>

Binary data associated with the response

Text

Response containing some arbitrary, text data

Fields of Text

data: String

Text data associated with the response

DirEntries

Response to reading a directory

Fields of DirEntries

entries: Vec<DirEntry>

Entries contained within the requested directory

errors: Vec<Error>

Errors encountered while scanning for entries

Exists(bool)

Response to checking if a path exists

Tuple Fields of Exists

0: bool
Metadata

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

Fields of Metadata

canonicalized_path: Option<PathBuf>

Canonicalized path to the file or directory, resolving symlinks, only included if flagged during the request

file_type: FileType

Represents the type of the entry as a file/dir/symlink

len: u64

Size of the file/directory/symlink in bytes

readonly: bool

Whether or not the file/directory/symlink is marked as unwriteable

accessed: Option<u128>

Represents the last time (in milliseconds) when the file/directory/symlink was accessed; can be optional as certain systems don’t support this

created: Option<u128>

Represents when (in milliseconds) the file/directory/symlink was created; can be optional as certain systems don’t support this

modified: Option<u128>

Represents the last time (in milliseconds) when the file/directory/symlink was modified; can be optional as certain systems don’t support this

ProcStart

Response to starting a new process

Fields of ProcStart

id: usize

Arbitrary id associated with running process

ProcStdout

Actively-transmitted stdout as part of running process

Fields of ProcStdout

id: usize

Arbitrary id associated with running process

data: String

Data read from a process’ stdout pipe

ProcStderr

Actively-transmitted stderr as part of running process

Fields of ProcStderr

id: usize

Arbitrary id associated with running process

data: String

Data read from a process’ stderr pipe

ProcDone

Response to a process finishing

Fields of ProcDone

id: usize

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

ProcEntries

Response to retrieving a list of managed processes

Fields of ProcEntries

entries: Vec<RunningProcess>

List of managed processes

SystemInfo

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

Fields of SystemInfo

family: String

Family of the operating system as described in https://doc.rust-lang.org/std/env/consts/constant.FAMILY.html

os: String

Name of the specific operating system as described in https://doc.rust-lang.org/std/env/consts/constant.OS.html

arch: String

Architecture of the CPI as described in https://doc.rust-lang.org/std/env/consts/constant.ARCH.html

current_dir: PathBuf

Current working directory of the running server process

main_separator: char

Primary separator for path components for the current platform as defined in https://doc.rust-lang.org/std/path/constant.MAIN_SEPARATOR.html

Implementations

Trait Implementations

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.