pub enum Fault {
Truncate,
WrongType,
ExtraField,
UnregisteredKey,
WrongQos,
MissingEncoding,
Unstamped,
}Expand description
A single deliberate deviation from a known-valid synthesized sample (#163).
Fault injection is a mode of the generator, not a sibling tool: it reuses
the whole registry walk, synthesis, scheduling, and guard machinery, then
perturbs one dimension of the output after synthesis — so the delta
from valid is always known, printable (Fault::delta), and stamped into
the marker ("fault": "<kind>", RFC 09 §5.3). The point is
consumer-robustness testing: a consumer that crashes on a truncated payload
fails RFC 09 §5.1 O1’s spirit — a non-conforming sample is a fact to
report, not an error to die on.
Variants§
Truncate
Cut the encoded payload to half its bytes — a partial frame the decoder meets mid-value.
WrongType
Replace the body with a JSON value of the wrong shape for the declared type (a bare string where a structured type is declared).
ExtraField
Add an undeclared field to the (JSON) body — the extra key a strict schema must reject or a lenient one must ignore, never choke on.
UnregisteredKey
Publish on a key that matches no registered subject (a trailing chunk the registry never declared).
WrongQos
Publish under a QoS profile other than the subject’s declared one (RFC 04 §3) — the observed-vs-declared mismatch a doctor listen flags.
MissingEncoding
Publish with no wire Encoding set, though the subject declares one —
a consumer keyed on the encoding meets a blank.
Unstamped
Publish a state sample carrying no HLC timestamp: LWW cannot order it (RFC 04 §4), and freshness is unjudgeable.
Implementations§
Source§impl Fault
impl Fault
Trait Implementations§
impl Copy for Fault
impl Eq for Fault
impl StructuralPartialEq for Fault
Auto Trait Implementations§
impl Freeze for Fault
impl RefUnwindSafe for Fault
impl Send for Fault
impl Sync for Fault
impl Unpin for Fault
impl UnsafeUnpin for Fault
impl UnwindSafe for Fault
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more