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
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
Response containing some arbitrary, binary data
Response containing some arbitrary, text data
Fields of Text
data: String
Text data associated with the response
Response to reading a directory
Fields of DirEntries
Exists(bool)
Response to checking if a path exists
Tuple Fields of Exists
0: bool
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
Response to starting a new process
Fields of ProcStart
id: usize
Arbitrary id associated with running process
Actively-transmitted stdout as part of running process
Fields of ProcStdout
Actively-transmitted stderr as part of running process
Fields of ProcStderr
Response to a process finishing
Fields of ProcDone
Response to retrieving a list of managed processes
Fields of ProcEntries
entries: Vec<RunningProcess>
List of managed processes
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
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 !=
.
Auto Trait Implementations
impl RefUnwindSafe for ResponseData
impl Send for ResponseData
impl Sync for ResponseData
impl Unpin for ResponseData
impl UnwindSafe for ResponseData
Blanket Implementations
Mutably borrows from an owned value. Read more