SpecProblem

Struct SpecProblem 

Source
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: StatusCode

Status 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>

Source

pub fn new(status_code: StatusCode) -> Self

Get new spec problem with given status code.

Source

pub fn with_violated(self, violated: &'static Requirement<Spec>) -> Self

With violated.

Source

pub fn with_recourse_as_per( self, recourse_as_per: &'static Requirement<Spec>, ) -> Self

With recourse as per.

Source

pub fn with_spec_problem_detail(self, violation_detail: &str) -> Self

With spec problem detail.

Source

pub fn with_instance(self, instance: UriReferenceString) -> Self

With instance.

Trait Implementations§

Source§

impl<Spec> Clone for SpecProblem<Spec>
where Spec: Specification + Clone,

Source§

fn clone(&self) -> SpecProblem<Spec>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Spec> Debug for SpecProblem<Spec>
where Spec: Specification + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Spec> Error for SpecProblem<Spec>
where Spec: Specification, Self: Debug + Display,

1.30.0 · Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<Spec: Specification> From<SpecProblem<Spec>> for ApiError

Source§

fn from(val: SpecProblem<Spec>) -> Self

Converts to this type from the input type.
Source§

impl<Spec: Specification> From<SpecProblem<Spec>> for ApiErrorBuilder

Source§

fn from(val: SpecProblem<Spec>) -> Self

Converts to this type from the input type.
Source§

impl<Spec: Specification> From<SpecProblem<Spec>> for ProblemBuilder

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

Source§

type Remainder = Choices

Source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

Source§

fn lift_into(self) -> U

Performs the indexed conversion.
Source§

impl<Source> Sculptor<HNil, HNil> for Source

Source§

type Remainder = Source

Source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, P> TryProven<P> for S

Source§

type Err = ProvenError<S, <P as SyncEvaluablePredicate<S>>::EvalError>

Type of error.
Source§

fn try_proven(self) -> Result<Proven<S, P>, <S as TryProven<P>>::Err>

A trait for subjects, to try to create proven propositions with evaluating predicate..