pub struct ConformanceRow {
pub version: u64,
pub event_type: String,
pub schema_version: u32,
pub payload: Vec<u8>,
pub metadata: Option<Vec<u8>>,
}Expand description
One row of test data fed into an adapter for the conformance suite to observe back out. All fields must round-trip byte-for-byte.
Fields§
§version: u64§event_type: String§schema_version: u32§payload: Vec<u8>§metadata: Option<Vec<u8>>Implementations§
Source§impl ConformanceRow
impl ConformanceRow
Sourcepub fn new(version: u64, event_type: &str, payload: Vec<u8>) -> Self
pub fn new(version: u64, event_type: &str, payload: Vec<u8>) -> Self
Convenience constructor: schema_version = 1, no metadata.
Sourcepub const fn with_schema_version(self, schema_version: u32) -> Self
pub const fn with_schema_version(self, schema_version: u32) -> Self
Set the schema version (defaults to 1).
Sourcepub fn with_metadata(self, metadata: Vec<u8>) -> Self
pub fn with_metadata(self, metadata: Vec<u8>) -> Self
Attach metadata (defaults to absent).
metadata must be non-empty — empty metadata is unrepresentable
(ValueError::MetadataEmpty); use absent instead.
Trait Implementations§
Source§impl Clone for ConformanceRow
impl Clone for ConformanceRow
Source§fn clone(&self) -> ConformanceRow
fn clone(&self) -> ConformanceRow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConformanceRow
impl Debug for ConformanceRow
impl Eq for ConformanceRow
Source§impl PartialEq for ConformanceRow
impl PartialEq for ConformanceRow
impl StructuralPartialEq for ConformanceRow
Auto Trait Implementations§
impl Freeze for ConformanceRow
impl RefUnwindSafe for ConformanceRow
impl Send for ConformanceRow
impl Sync for ConformanceRow
impl Unpin for ConformanceRow
impl UnsafeUnpin for ConformanceRow
impl UnwindSafe for ConformanceRow
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