pub enum Integrity<T> {
Ok(T),
Missing(Element),
Err(Element),
}Expand description
The integrity of a field. Building an IR value is infallible.
Every field ends in one of these states rather than aborting the build.
The detail behind Err (the kind mismatch, the invalid value) is recorded
in the accompanying warning::Set.
A field the OCPI spec defines as optional is typed Integrity<Option<T>>: an
absent optional field is Ok(None), not Integrity::Missing.
Integrity::Missing therefore only ever describes an absent (or null)
required field, which is also reported as a Warning::MissingField.
Variants§
Ok(T)
The field was present and built successfully.
Missing(Element)
A required field was absent or null. This is also reported as a
Warning::MissingField. The location is the containing object’s, since an
absent field has no element of its own.
Err(Element)
The field was present but could not be built (wrong JSON kind, or an otherwise invalid value). The location is the field’s own.
Implementations§
Trait Implementations§
impl<T: Eq> Eq for Integrity<T>
impl<T: PartialEq> StructuralPartialEq for Integrity<T>
Auto Trait Implementations§
impl<T> Freeze for Integrity<T>where
T: Freeze,
impl<T> RefUnwindSafe for Integrity<T>where
T: RefUnwindSafe,
impl<T> Send for Integrity<T>where
T: Send,
impl<T> Sync for Integrity<T>where
T: Sync,
impl<T> Unpin for Integrity<T>where
T: Unpin,
impl<T> UnsafeUnpin for Integrity<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Integrity<T>where
T: UnwindSafe,
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
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> IntoCaveat for T
impl<T> IntoCaveat for T
Source§fn into_caveat<W>(self, warnings: Set<W>) -> Caveat<T, W>where
W: Warning,
fn into_caveat<W>(self, warnings: Set<W>) -> Caveat<T, W>where
W: Warning,
Caveat<T> by supplying a list of Warnings.Source§fn into_infallible_caveat(self) -> Caveat<Self, Infallible>
fn into_infallible_caveat(self) -> Caveat<Self, Infallible>
FromSchema is infallible a Caveat can be created using this method.