pub struct Batch {
pub schema: u32,
pub install: String,
pub client: Client,
pub modules: Vec<String>,
pub events: Vec<EventRecord>,
}Expand description
A whole reporting batch, version SCHEMA. Built only by
Batch::parse, which enforces the grammar this type’s shape can only
suggest: the derives exist for the wire format and the status round
trip, never as an ingest path.
Fields§
§schema: u32The schema version; always SCHEMA after a parse.
install: StringThe install id: 32 lowercase hex characters.
client: ClientWhat reported.
modules: Vec<String>Which of the venture’s declared modules the client composes, no duplicates.
events: Vec<EventRecord>One or more counted events.
Implementations§
Source§impl Batch
impl Batch
Sourcepub fn parse(value: &Value, vocabulary: &Vocabulary) -> Result<Self, Rejection>
pub fn parse(value: &Value, vocabulary: &Vocabulary) -> Result<Self, Rejection>
Parses a batch against the venture’s declared vocabulary. Every
value outside the grammar — an unknown field, an undeclared name, a
malformed id, a version with a pre-release tag, a count out of
range, an error class that contradicts the outcome — is a
Rejection, never a truncation or a coercion (issue #413).
The parse is written by hand over serde_json::Value rather than
delegated to serde’s deserializers on purpose: serde’s error
messages quote the offending value, and a quoted value is exactly
what a rejection body must never carry.
§Errors
A Rejection naming the field path and the rule that was broken.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Batch
impl<'de> Deserialize<'de> for Batch
Source§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>,
impl Eq for Batch
impl StructuralPartialEq for Batch
Auto Trait Implementations§
impl Freeze for Batch
impl RefUnwindSafe for Batch
impl Send for Batch
impl Sync for Batch
impl Unpin for Batch
impl UnsafeUnpin for Batch
impl UnwindSafe for Batch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.