pub enum SchemaError {
NotAnObject {
path: String,
},
NoType {
path: String,
},
BadKeyword {
path: String,
keyword: &'static str,
expected: &'static str,
},
RecordWithoutSchema {
path: String,
},
NotADefinition {
path: String,
kind: &'static str,
},
PrimaryNotMain {
path: String,
kind: &'static str,
},
}Expand description
Why a lexicon document could not be turned into a schema tree.
Every one of these is a defect in a lexicon document rather than in a record. For the documents this project embeds it is a build-time bug, and the unit tests in this module are what catch it.
Variants§
NotAnObject
A definition or property was not a JSON object.
NoType
A schema had no type.
BadKeyword
A keyword held the wrong kind of JSON value.
Fields
RecordWithoutSchema
A record definition had no record object.
NotADefinition
A type that is only a field type appeared in definition position.
unknown and ref describe a slot inside a schema: “whatever the
writer put here” and “look over there”. Neither says anything a
document could define, so upstream refuses both under defs.
PrimaryNotMain
A primary definition was named something other than main.
Records and methods are addressed by the NSID of the document holding
them, so a second one in the same document has no name to be reached
by; the specification puts the primary under main and only main.
Trait Implementations§
Source§impl Clone for SchemaError
impl Clone for SchemaError
Source§fn clone(&self) -> SchemaError
fn clone(&self) -> SchemaError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
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 PartialEq for SchemaError
impl PartialEq for SchemaError
Source§fn eq(&self, other: &SchemaError) -> bool
fn eq(&self, other: &SchemaError) -> bool
self and other values to be equal, and is used by ==.impl Eq for SchemaError
impl StructuralPartialEq for SchemaError
Auto Trait Implementations§
impl Freeze for SchemaError
impl RefUnwindSafe for SchemaError
impl Send for SchemaError
impl Sync for SchemaError
impl Unpin for SchemaError
impl UnsafeUnpin for SchemaError
impl UnwindSafe 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.