pub struct Envelope {
pub warden_version: &'static str,
pub record_version: u32,
pub report: String,
pub period: Period,
pub rows: Vec<Value>,
pub notes: Vec<String>,
}Expand description
The one shape every --json response has.
rows is Value rather than a typed row: the row shape is per report and
may gain fields freely, so the envelope stays report-agnostic.
Fields§
§warden_version: &'static str§record_version: u32§report: String§period: Period§rows: Vec<Value>§notes: Vec<String>Implementations§
Source§impl Envelope
impl Envelope
pub fn new( report: impl Into<String>, window: TimeWindow, rows: Vec<Value>, ) -> Self
Sourcepub fn with_notes<S: Into<String>>(
self,
notes: impl IntoIterator<Item = S>,
) -> Self
pub fn with_notes<S: Into<String>>( self, notes: impl IntoIterator<Item = S>, ) -> Self
Attach the caller-supplied notes (e.g. "cost figures are estimates").
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