Skip to main content

Warning

Enum Warning 

Source
pub enum Warning<B> {
    MalformedIri(String),
    EmptyTerm,
    BlankNodeIdProperty(B),
    MalformedLanguageTag(String, InvalidLangTag<String>),
    ContextProcessing(Warning),
}
Expand description

Warning raised while expanding a document.

Variants§

§

MalformedIri(String)

A term expanded to a string that is not a well-formed IRI. It becomes an invalid identifier, which the Policy in use decides to keep, drop or reject.

§

EmptyTerm

A JSON object has an empty key, which no context can define as a term.

§

BlankNodeIdProperty(B)

A key expanded to a blank node identifier, making it a property with no RDF equivalent unless generalized RDF is allowed.

§

MalformedLanguageTag(String, InvalidLangTag<String>)

A language tag is not well-formed per BCP 47. It is kept in the expanded document as it is; the warning carries the tag and the reason it was rejected.

§

ContextProcessing(Warning)

A warning raised while processing a scoped or local @context.

Implementations§

Source§

impl<B> Warning<B>

Source

pub fn map_blank_id<C>(self, map: impl FnOnce(B) -> C) -> Warning<C>

Rewrites the blank node identifier this warning carries, if any.

Warning::BlankNodeIdProperty is the only variant holding one. Use this when a warning crosses from one vocabulary to another, so that the handler resolving the identifier for display looks it up in the vocabulary that minted it rather than printing the wrong blank node.

Trait Implementations§

Source§

impl<B: Debug> Debug for Warning<B>

Source§

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

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

impl<B: Display> Display for Warning<B>

Source§

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

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

impl<B, N: BlankIdVocabulary<BlankId = B>> DisplayWithContext<N> for Warning<B>

Source§

fn fmt_with(&self, vocabulary: &N, f: &mut Formatter<'_>) -> Result

Source§

impl<B> From<MalformedIri> for Warning<B>

Source§

fn from(MalformedIri: MalformedIri) -> Self

Converts to this type from the input type.
Source§

impl<B> From<Warning> for Warning<B>

Source§

fn from(w: Warning) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<B> Freeze for Warning<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for Warning<B>
where B: RefUnwindSafe,

§

impl<B> Send for Warning<B>
where B: Send,

§

impl<B> Sync for Warning<B>
where B: Sync,

§

impl<B> Unpin for Warning<B>
where B: Unpin,

§

impl<B> UnsafeUnpin for Warning<B>
where B: UnsafeUnpin,

§

impl<B> UnwindSafe for Warning<B>
where B: UnwindSafe,

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> BorrowUnordered for T

Source§

fn as_unordered(&self) -> &Unordered<T>

Views this value as an Unordered reference.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

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, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

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

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 = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = !

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

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

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

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

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>
where T: Sized,