pub struct Violation { /* private fields */ }Expand description
A peer did something a sync rule forbids.
Every rule in rules returns Result<RuleOutcome, Violation>, and every emitter’s test function returns
Result<(), Violation>, so a failure reaches libtest — or
wasm-bindgen-test, which accepts the same shape — as the test’s error,
named by the clause it breaks. The event-store and projection families fail
by panicking instead; this family returns the failure because a rule that
cannot fail without a panic would need a panic! in this crate’s library
code, which the workspace’s standard forbids.
Debug prints what Display prints. Libtest reports a returned error
through Debug, and a derived one would bury the message in field syntax.
Implementations§
Trait Implementations§
impl Eq for Violation
Source§impl Error for Violation
impl Error for Violation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Violation
Auto Trait Implementations§
impl Freeze for Violation
impl RefUnwindSafe for Violation
impl Send for Violation
impl Sync for Violation
impl Unpin for Violation
impl UnsafeUnpin for Violation
impl UnwindSafe for Violation
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