pub struct SpecProblem<Spec>where
Spec: Specification,{
pub status_code: StatusCode,
pub violated: Option<&'static Requirement<Spec>>,
pub recourse_as_per: Option<&'static Requirement<Spec>>,
pub spec_problem_detail: Option<String>,
pub instance: Option<UriReferenceString>,
}Expand description
Struct representing a spec problem.
Fields§
§status_code: StatusCodeStatus code for problem.
violated: Option<&'static Requirement<Spec>>Violated requirement.
recourse_as_per: Option<&'static Requirement<Spec>>Specified recourse requirement.
spec_problem_detail: Option<String>Spec problem detail.
instance: Option<UriReferenceString>A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
Implementations§
Source§impl<Spec: Specification> SpecProblem<Spec>
impl<Spec: Specification> SpecProblem<Spec>
Sourcepub fn new(status_code: StatusCode) -> Self
pub fn new(status_code: StatusCode) -> Self
Get new spec problem with given status code.
Sourcepub fn with_violated(self, violated: &'static Requirement<Spec>) -> Self
pub fn with_violated(self, violated: &'static Requirement<Spec>) -> Self
With violated.
Sourcepub fn with_recourse_as_per(
self,
recourse_as_per: &'static Requirement<Spec>,
) -> Self
pub fn with_recourse_as_per( self, recourse_as_per: &'static Requirement<Spec>, ) -> Self
With recourse as per.
Sourcepub fn with_spec_problem_detail(self, violation_detail: &str) -> Self
pub fn with_spec_problem_detail(self, violation_detail: &str) -> Self
With spec problem detail.
Sourcepub fn with_instance(self, instance: UriReferenceString) -> Self
pub fn with_instance(self, instance: UriReferenceString) -> Self
With instance.
Trait Implementations§
Source§impl<Spec> Clone for SpecProblem<Spec>where
Spec: Specification + Clone,
impl<Spec> Clone for SpecProblem<Spec>where
Spec: Specification + Clone,
Source§fn clone(&self) -> SpecProblem<Spec>
fn clone(&self) -> SpecProblem<Spec>
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<Spec> Debug for SpecProblem<Spec>where
Spec: Specification + Debug,
impl<Spec> Debug for SpecProblem<Spec>where
Spec: Specification + Debug,
Source§impl<Spec> Error for SpecProblem<Spec>
impl<Spec> Error for SpecProblem<Spec>
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()
Source§impl<Spec: Specification> From<SpecProblem<Spec>> for ApiError
impl<Spec: Specification> From<SpecProblem<Spec>> for ApiError
Source§fn from(val: SpecProblem<Spec>) -> Self
fn from(val: SpecProblem<Spec>) -> Self
Converts to this type from the input type.
Source§impl<Spec: Specification> From<SpecProblem<Spec>> for ApiErrorBuilder
impl<Spec: Specification> From<SpecProblem<Spec>> for ApiErrorBuilder
Source§fn from(val: SpecProblem<Spec>) -> Self
fn from(val: SpecProblem<Spec>) -> Self
Converts to this type from the input type.
Source§impl<Spec: Specification> From<SpecProblem<Spec>> for ProblemBuilder
impl<Spec: Specification> From<SpecProblem<Spec>> for ProblemBuilder
Source§fn from(val: SpecProblem<Spec>) -> Self
fn from(val: SpecProblem<Spec>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Spec> Freeze for SpecProblem<Spec>
impl<Spec> RefUnwindSafe for SpecProblem<Spec>where
Spec: RefUnwindSafe,
impl<Spec> Send for SpecProblem<Spec>
impl<Spec> Sync for SpecProblem<Spec>
impl<Spec> Unpin for SpecProblem<Spec>
impl<Spec> UnwindSafe for SpecProblem<Spec>where
Spec: RefUnwindSafe,
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<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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<S, P> TryProven<P> for Swhere
P: Predicate<S> + SyncEvaluablePredicate<S>,
impl<S, P> TryProven<P> for Swhere
P: Predicate<S> + SyncEvaluablePredicate<S>,
Source§type Err = ProvenError<S, <P as SyncEvaluablePredicate<S>>::EvalError>
type Err = ProvenError<S, <P as SyncEvaluablePredicate<S>>::EvalError>
Type of error.