pub struct Tolerance { /* private fields */ }Expand description
What a destination is allowed to change, because its type system genuinely cannot represent the input.
Every allowance is a real, documented limitation of some destination — not a convenience. A pair that needs one is saying “this column cannot survive here”, which is worth stating explicitly in that pair’s test rather than hiding inside a loose comparison.
Implementations§
Source§impl Tolerance
impl Tolerance
Sourcepub fn exact() -> Self
pub fn exact() -> Self
No allowances: every value must land byte- and type-identical. Start here, and widen only with a comment naming the destination limitation.
Sourcepub fn float_epsilon(self, eps: f64) -> Self
pub fn float_epsilon(self, eps: f64) -> Self
Compare floats within a relative epsilon.
Sourcepub fn empty_string_becomes_null(self) -> Self
pub fn empty_string_becomes_null(self) -> Self
Accept null where an empty string was sent.
Sourcepub fn lenient_scalar_kind(self) -> Self
pub fn lenient_scalar_kind(self) -> Self
Accept a scalar whose JSON kind changed but whose rendering did not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tolerance
impl RefUnwindSafe for Tolerance
impl Send for Tolerance
impl Sync for Tolerance
impl Unpin for Tolerance
impl UnsafeUnpin for Tolerance
impl UnwindSafe for Tolerance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request