pub enum InvalidContext {
InvalidIriRef(String),
Unexpected(Kind, &'static [Kind]),
InvalidDirection,
DuplicateKey,
InvalidTermDefinition,
InvalidNestValue(String),
TooDeep,
}Expand description
Error raised when a JSON value is not a valid context.
Variants§
InvalidIriRef(String)
A context entry was a string that is not a valid IRI reference. Holds the rejected string.
Unexpected(Kind, &'static [Kind])
A value had the wrong JSON kind. Holds the kind that was found and the kinds that would have been accepted.
InvalidDirection
A @direction entry was a string other than "ltr" or "rtl".
DuplicateKey
The same key appeared twice in a context definition or in a term definition.
InvalidTermDefinition
A term definition, or a structured entry of a context definition such as
@type or @version, held an entry or a value the grammar does not
allow there.
InvalidNestValue(String)
A @nest entry held a keyword other than @nest. Holds the rejected
string.
TooDeep
Scoped-context nesting exceeds MAX_CONTEXT_DEPTH.
Implementations§
Trait Implementations§
Source§impl Clone for InvalidContext
impl Clone for InvalidContext
Source§impl Debug for InvalidContext
impl Debug for InvalidContext
Source§impl Display for InvalidContext
impl Display for InvalidContext
Source§impl Error for InvalidContext
impl Error for InvalidContext
1.30.0 · 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<Unexpected> for InvalidContext
impl From<Unexpected> for InvalidContext
Source§fn from(crate::Unexpected: Unexpected) -> Self
fn from(crate::Unexpected: Unexpected) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InvalidContext
impl RefUnwindSafe for InvalidContext
impl Send for InvalidContext
impl Sync for InvalidContext
impl Unpin for InvalidContext
impl UnsafeUnpin for InvalidContext
impl UnwindSafe for InvalidContext
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.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<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more