pub struct SchemaErrors(/* private fields */);Expand description
Collection of ReportedErrors returned by Manifest::parse_toml and
Index::parse_json.
Always non-empty when returned as Err(SchemaErrors) — parse functions
return Ok(_) iff no validation errors were found.
Implementations§
Source§impl SchemaErrors
impl SchemaErrors
Sourcepub fn new(errors: Vec<ReportedError>) -> SchemaErrors
pub fn new(errors: Vec<ReportedError>) -> SchemaErrors
Debug-asserts errors is non-empty; constructing an empty
SchemaErrors is a programming error (use Ok(_) for no errors).
Sourcepub fn single_at_root(error: SchemaError) -> SchemaErrors
pub fn single_at_root(error: SchemaError) -> SchemaErrors
Convenience for syntax-level errors (TomlParse / JsonParse) and schema-version short-circuit errors.
pub fn errors(&self) -> &[ReportedError]
pub fn into_vec(self) -> Vec<ReportedError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for SchemaErrors
impl Debug for SchemaErrors
Source§impl Display for SchemaErrors
impl Display for SchemaErrors
Source§impl Error for SchemaErrors
impl Error for SchemaErrors
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 From<SchemaErrors> for Vec<ReportedError>
impl From<SchemaErrors> for Vec<ReportedError>
Source§fn from(errors: SchemaErrors) -> Vec<ReportedError>
fn from(errors: SchemaErrors) -> Vec<ReportedError>
Converts to this type from the input type.
Source§impl<'a> IntoIterator for &'a SchemaErrors
impl<'a> IntoIterator for &'a SchemaErrors
Source§type Item = &'a ReportedError
type Item = &'a ReportedError
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, ReportedError>
type IntoIter = Iter<'a, ReportedError>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a SchemaErrors as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a SchemaErrors as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl IntoIterator for SchemaErrors
impl IntoIterator for SchemaErrors
Source§type Item = ReportedError
type Item = ReportedError
The type of the elements being iterated over.
Source§type IntoIter = IntoIter<ReportedError>
type IntoIter = IntoIter<ReportedError>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <SchemaErrors as IntoIterator>::IntoIter
fn into_iter(self) -> <SchemaErrors as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SchemaErrors
impl !UnwindSafe for SchemaErrors
impl Freeze for SchemaErrors
impl Send for SchemaErrors
impl Sync for SchemaErrors
impl Unpin for SchemaErrors
impl UnsafeUnpin for SchemaErrors
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> 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 more