pub enum Integrity<T> {
Ok(T),
Missing,
Err,
}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
A required field was absent or null. This is also reported as a
Warning::MissingField.
Err
The field was present but could not be built (wrong JSON kind, or an otherwise invalid value).
Implementations§
Trait Implementations§
impl<T: Copy> Copy for Integrity<T>
impl<T: Eq> Eq for Integrity<T>
Source§impl<T: PartialEq> PartialEq for Integrity<T>
impl<T: PartialEq> PartialEq 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
Mutably borrows from an owned value. Read more