#[non_exhaustive]pub enum DialectError {
UnprovenUnion {
pointer: String,
keyword: String,
},
ConstrainingRefSibling {
pointer: String,
keyword: String,
},
UnresolvableRef {
pointer: String,
},
RecursiveRef {
pointer: String,
},
TooDeep {
pointer: String,
limit: usize,
},
NotAnObject {
pointer: String,
},
}Expand description
A schema could not be rewritten without weakening it.
Display names a JSON pointer and a keyword, both of them from a schema the
application wrote. Neither model output nor user text can reach these
fields.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnprovenUnion
A union’s branches could not be proven mutually exclusive, so rewriting
it as anyOf would accept documents the source schema rejects.
Fields
ConstrainingRefSibling
A $ref carries a sibling that constrains, so neither dropping it nor
lifting it is safe.
UnresolvableRef
A $ref names something this module cannot resolve: a remote document,
or a pointer into a part of the schema that is not a definition table.
RecursiveRef
A definition refers to itself, directly or through others. Inlining it does not terminate.
TooDeep
The schema expands or nests deeper than the rewrite allows. limit
says which bound was reached.
NotAnObject
A sub-schema is a boolean rather than an object, in a position where the rewrite has nothing to attach to.
Implementations§
Source§impl DialectError
impl DialectError
Sourcepub fn keyword(&self) -> &str
pub fn keyword(&self) -> &str
The keyword at fault, or a short label for the structural failures.
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Stable snake-case label of the failure family, for metrics and codes.
Sourcepub fn code(&self) -> ErrorCode
pub fn code(&self) -> ErrorCode
The error code an adapter attaches when it turns this into a
ProviderError.
Trait Implementations§
Source§impl Clone for DialectError
impl Clone for DialectError
Source§impl Debug for DialectError
impl Debug for DialectError
Source§impl Display for DialectError
impl Display for DialectError
impl Eq for DialectError
Source§impl Error for DialectError
impl Error for DialectError
1.30.0 · 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()
Source§impl From<DialectError> for ProviderError
impl From<DialectError> for ProviderError
Source§fn from(value: DialectError) -> Self
fn from(value: DialectError) -> Self
A schema the dialect cannot carry is an
Unsupported feature,
whose retry class is Fallback.
The capability declaration stays true: this provider does enforce schemas, it just cannot enforce this one. So the router may offer the turn to another profile, and must not re-roll against the same one.
Source§impl PartialEq for DialectError
impl PartialEq for DialectError
impl StructuralPartialEq for DialectError
Auto Trait Implementations§
impl Freeze for DialectError
impl RefUnwindSafe for DialectError
impl Send for DialectError
impl Sync for DialectError
impl Unpin for DialectError
impl UnsafeUnpin for DialectError
impl UnwindSafe for DialectError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.