#[non_exhaustive]pub enum SchemaError {
Show 23 variants
InvalidPluginName {
name: String,
},
ReservedPluginName {
name: String,
},
InvalidVersion {
version: String,
source: Error,
},
DescriptionTooLong {
len: usize,
},
DescriptionEmpty,
DescriptionMultiline {
len: usize,
},
InvalidUrlScheme {
url: String,
scheme: String,
},
InvalidUrl {
url: String,
source: ParseError,
},
UnknownTriggerType {
trigger: String,
},
EmptyTriggers,
InvalidDatabaseVersion {
range: String,
source: Error,
},
InvalidPythonRequirement {
requirement: String,
source: Box<Pep508Error>,
},
UnsupportedArtifactScheme {
url: String,
scheme: String,
},
InvalidHash {
value: String,
},
InvalidPublishedAt {
value: String,
},
DuplicateIndexEntry {
name: String,
version: String,
},
CanonicalCollision {
name: String,
canonical: String,
existing: Vec<(String, String)>,
},
UnsupportedManifestMajor {
found: String,
supported: u32,
},
UnsupportedIndexMajor {
found: String,
supported: u32,
},
MalformedSchemaVersion {
value: String,
},
TomlParse {
source: Error,
},
JsonParse {
source: Error,
},
JsonSerialize {
source: Error,
},
}Expand description
Errors produced during schema parsing and validation.
Adding variants is a minor-version change; renaming, removing, reshaping, or adding fields to existing variants is a major-version change. To evolve a variant’s payload, introduce a new variant rather than mutating the old.
#[non_exhaustive]: downstream matches must include a _ => arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPluginName
ReservedPluginName
InvalidVersion
DescriptionTooLong
DescriptionEmpty
DescriptionMultiline
InvalidUrlScheme
InvalidUrl
UnknownTriggerType
EmptyTriggers
InvalidDatabaseVersion
InvalidPythonRequirement
A dependencies.python entry failed PEP 508 parsing.
The source type comes from pre-1.0 pep508_rs; prefer .source()
over matching the typed field to avoid coupling to its semver.
UnsupportedArtifactScheme
InvalidHash
InvalidPublishedAt
DuplicateIndexEntry
CanonicalCollision
UnsupportedManifestMajor
UnsupportedIndexMajor
MalformedSchemaVersion
TomlParse
JsonParse
JsonSerialize
Implementations§
Source§impl SchemaError
impl SchemaError
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Stable string tag for the variant. Use for metrics keys, log categorization, and routing that must survive field-level changes.
The exhaustive match forces new variants to be registered in
every_variant() (compile error otherwise).
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for SchemaError
impl !UnwindSafe for SchemaError
impl Freeze for SchemaError
impl Send for SchemaError
impl Sync for SchemaError
impl Unpin for SchemaError
impl UnsafeUnpin for SchemaError
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> 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>
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>
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