Skip to main content

SchemaError

Enum SchemaError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidPluginName

Fields

§name: String
§

ReservedPluginName

Fields

§name: String
§

InvalidVersion

Fields

§version: String
§source: Error
§

DescriptionTooLong

Fields

§len: usize
§

DescriptionEmpty

§

DescriptionMultiline

Fields

§len: usize
§

InvalidUrlScheme

Fields

§scheme: String
§

InvalidUrl

Fields

§source: ParseError
§

UnknownTriggerType

Fields

§trigger: String
§

EmptyTriggers

§

InvalidDatabaseVersion

Fields

§range: String
§source: Error
§

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.

Fields

§requirement: String
§

UnsupportedArtifactScheme

Fields

§scheme: String
§

InvalidHash

Fields

§value: String
§

InvalidPublishedAt

Fields

§value: String
§

DuplicateIndexEntry

Fields

§name: String
§version: String
§

CanonicalCollision

Fields

§name: String
§canonical: String
§existing: Vec<(String, String)>
§

UnsupportedManifestMajor

Fields

§found: String
§supported: u32
§

UnsupportedIndexMajor

Fields

§found: String
§supported: u32
§

MalformedSchemaVersion

Fields

§value: String
§

TomlParse

Fields

§source: Error
§

JsonParse

Fields

§source: Error
§

JsonSerialize

Fields

§source: Error

Implementations§

Source§

impl SchemaError

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for SchemaError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for SchemaError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.