pub struct ConstraintViolation { /* private fields */ }Expand description
Represents a violation of a constraint.
Implementations§
Source§impl ConstraintViolation
impl ConstraintViolation
Sourcepub fn new<S: Into<String>, D: Into<String>>(
constraint_name: S,
description: D,
) -> Self
pub fn new<S: Into<String>, D: Into<String>>( constraint_name: S, description: D, ) -> Self
Creates a new constraint violation with the given name and description.
Sourcepub fn with_severity<S: Into<String>, D: Into<String>>(
constraint_name: S,
description: D,
severity: f64,
) -> Self
pub fn with_severity<S: Into<String>, D: Into<String>>( constraint_name: S, description: D, severity: f64, ) -> Self
Creates a new constraint violation with the given name, description, and severity.
Sourcepub fn constraint_name(&self) -> &str
pub fn constraint_name(&self) -> &str
Returns the name of the constraint that was violated.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the description of the violation.
Trait Implementations§
Source§impl Clone for ConstraintViolation
impl Clone for ConstraintViolation
Source§fn clone(&self) -> ConstraintViolation
fn clone(&self) -> ConstraintViolation
Returns a duplicate of the value. Read more
1.0.0 · 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 ConstraintViolation
impl Debug for ConstraintViolation
Auto Trait Implementations§
impl Freeze for ConstraintViolation
impl RefUnwindSafe for ConstraintViolation
impl Send for ConstraintViolation
impl Sync for ConstraintViolation
impl Unpin for ConstraintViolation
impl UnwindSafe for ConstraintViolation
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 more