pub struct Envelope {
pub capturer: String,
pub version: String,
pub captured_at: String,
pub args: Value,
pub result: Value,
}Expand description
The canonical wrapper written to --out by every capturer.
Fields§
§capturer: String§version: String§captured_at: String§args: Value§result: ValueImplementations§
Source§impl Envelope
impl Envelope
Sourcepub fn new(capturer: &str, version: &str, args: Value, result: Value) -> Self
pub fn new(capturer: &str, version: &str, args: Value, result: Value) -> Self
Build an envelope. captured_at is filled from
crate::time::now_iso8601 and args/result are
canonicalized so the final JSON is byte-stable.
Sourcepub fn to_canonical_json(&self) -> Result<String>
pub fn to_canonical_json(&self) -> Result<String>
Serialize to a canonical pretty-printed JSON string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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