pub struct Envelope<'a, T: Serialize> {
pub schema_version: &'static str,
pub command: &'a str,
pub status: &'static str,
pub data: Option<T>,
pub error: Option<ErrorEnvelope>,
pub warnings: Option<Vec<String>>,
}Expand description
Top-level JSON envelope written to stdout in JSON mode.
Successful runs SHALL omit the error field; failed runs SHALL omit
the data field. Both omissions are achieved through serde’s
skip_serializing_if = "Option::is_none".
Fields§
§schema_version: &'static strStable schema version (semver-style).
command: &'a strCommand name (e.g. "match", "sync", "convert").
status: &'static strEither "ok" or "error".
data: Option<T>Command-specific payload. Omitted when status == "error".
error: Option<ErrorEnvelope>Error envelope. Omitted when status == "ok".
warnings: Option<Vec<String>>Optional non-fatal warnings.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Envelope<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Envelope<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Envelope<'a, T>where
T: Send,
impl<'a, T> Sync for Envelope<'a, T>where
T: Sync,
impl<'a, T> Unpin for Envelope<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for Envelope<'a, T>where
T: UnsafeUnpin,
impl<'a, T> UnwindSafe for Envelope<'a, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more