#[non_exhaustive]pub struct FixtureCase {
pub name: String,
pub direction: String,
pub headers: BTreeMap<String, String>,
pub envelope: FixtureEnvelope,
pub encode_from: Option<FixtureEnvelope>,
}Expand description
One cases/*.json file. Unknown fields (grounding, notes, error, …)
are ignored: they carry provenance for humans, not assertions for this side.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe case’s name, as its filename declares it. Use it in assertion messages — a failure that names the case is one lookup from the file.
direction: StringWhich half of the contract this case asserts, as the raw string. Prefer
FixtureCase::direction.
headers: BTreeMap<String, String>The complete header set for the case, including the server-trusted identity headers a producer must never emit — an authenticating edge sets those, and the corpus carries the spelling its authoring deployment uses.
envelope: FixtureEnvelopeThe envelope the headers correspond to.
encode_from: Option<FixtureEnvelope>Present only on lossy (direction: encode) cases: the logical envelope
a producer starts from, before truncation / drop / percent-encoding.
Implementations§
Source§impl FixtureCase
impl FixtureCase
Sourcepub fn logical_envelope(&self) -> &FixtureEnvelope
pub fn logical_envelope(&self) -> &FixtureEnvelope
The envelope a producer starts from: Self::encode_from on a lossy
case, the case’s own envelope otherwise.
§Panics
If a non-encode case carries an encode_from. The corpus reserves
that field for lossy cases, so a roundtrip case carrying one is
claiming encode(envelope) == headers while handing the producer a
different input. Whichever of the two it means, the case is not saying
it — better to fail than to silently prefer one.
Sourcepub fn expected_tapes_headers(&self) -> BTreeMap<String, String>
pub fn expected_tapes_headers(&self) -> BTreeMap<String, String>
The x-tapes-* subset of this case’s expected headers — what a
producer must emit, with the server-trusted headers excluded.
Trait Implementations§
Source§impl Clone for FixtureCase
impl Clone for FixtureCase
Source§fn clone(&self) -> FixtureCase
fn clone(&self) -> FixtureCase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more