pub struct FormaError {
pub issues: Vec<FormaIssue>,
}Expand description
Every constraint violated during one parse call, in declaration order (ER-1).
parse()/validate_value() always return at least one issue on failure,
but the field is public so no non-empty guarantee is claimed at the type
level — hence first() returns an Option.
Fields§
§issues: Vec<FormaIssue>All issues collected before the error was returned, in declaration order.
Implementations§
Source§impl FormaError
impl FormaError
Sourcepub fn first(&self) -> Option<&FormaIssue>
pub fn first(&self) -> Option<&FormaIssue>
The earliest-collected issue, or None for a hand-constructed empty error.
Sourcepub fn issues_for<'a>(
&'a self,
path: &'a FieldPath,
) -> impl Iterator<Item = &'a FormaIssue>
pub fn issues_for<'a>( &'a self, path: &'a FieldPath, ) -> impl Iterator<Item = &'a FormaIssue>
Iterates only the issues addressed to path.
Trait Implementations§
Source§impl Clone for FormaError
impl Clone for FormaError
Source§fn clone(&self) -> FormaError
fn clone(&self) -> FormaError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FormaError
impl Debug for FormaError
Source§impl Default for FormaError
impl Default for FormaError
Source§fn default() -> FormaError
fn default() -> FormaError
Returns the “default value” for a type. Read more
Source§impl Display for FormaError
impl Display for FormaError
Source§impl Error for FormaError
impl Error for FormaError
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 PartialEq for FormaError
impl PartialEq for FormaError
impl StructuralPartialEq for FormaError
Auto Trait Implementations§
impl Freeze for FormaError
impl RefUnwindSafe for FormaError
impl Send for FormaError
impl Sync for FormaError
impl Unpin for FormaError
impl UnsafeUnpin for FormaError
impl UnwindSafe for FormaError
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> 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<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.