pub struct Reply {
pub id: String,
pub rc: i32,
pub err: Option<DeviceErr>,
/* private fields */
}Expand description
A device’s answer. #[must_use] because rc != 0 is returned, never raised: a dropped Reply
is a device error nobody looked at.
Fields§
§id: StringThe request id this answers. Already checked against the request that was sent, so a late reply from a timed-out command can never arrive here as this command’s answer.
rc: i32A platform errno, INFORMATIVE ONLY — the same “unknown command” is -38 on Linux and -88 on
this target, which is exactly why err is the contract (kdi/contract.yaml:23-23).
err: Option<DeviceErr>None on success — and also for a token this build does not know, which is legal from a
device on a newer minor and must never be a parse failure. ok() still reports false,
because it tests rc.
Implementations§
Source§impl Reply
impl Reply
Sourcepub fn ok(&self) -> bool
pub fn ok(&self) -> bool
Did the device accept the command? Tests rc, so it is false for a refusal whose err
token this build does not recognise.