Skip to main content

Warning

Enum Warning 

Source
pub enum Warning {
    Country(Warning),
    Currency(Warning),
    DateTime(Warning),
    Decode(Warning),
    Duration(Warning),
    FieldInvalidValue {
        value: String,
        message: Cow<'static, str>,
    },
    Money(Warning),
    NoElements,
    Number(Warning),
    String(Warning),
    Rejected,
}
Expand description

The warnings that happen when reading a tariff.

Variants§

§

Country(Warning)

Raised while reading the tariff’s country_code.

§

Currency(Warning)

Raised while reading the tariff’s currency code.

§

DateTime(Warning)

Raised while reading a timestamp.

§

Decode(Warning)

Raised while decoding a JSON string’s escape sequences.

§

Duration(Warning)

Raised while reading a duration.

§

FieldInvalidValue

A field in the tariff doesn’t have the expected value.

Fields

§value: String

The value encountered.

§message: Cow<'static, str>

A message about what values are expected for this field.

§

Money(Warning)

Raised while reading a price.

§

NoElements

The tariff has no Elements.

§

Number(Warning)

Raised while reading a number.

§

String(Warning)

Raised while reading a string.

§

Rejected

Raised when build rejects a tariff object because a field the object must have is missing, is null or has a value check can’t read. The warning sits at the field, or at the object when the field is missing. A schema::Warning that check returns says what is wrong with the field (see warning::Rejected).

Trait Implementations§

Source§

impl Debug for Warning

Source§

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

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

impl Display for Warning

Source§

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

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

impl From<Rejected> for Warning

Source§

fn from(_: Rejected) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl From<Warning> for Warning

Convert from Warning A to B.

Source§

fn from(warning: Warning) -> Self

Converts to this type from the input type.
Source§

impl Warning for Warning

Source§

fn id(&self) -> Id

Return the human readable identifier for the Warning. Read more
Source§

fn is_rejected(&self) -> bool

Whether this is the Rejected marker a feature emits when it rejects the schema IR for the object it is building. Read more

Auto Trait Implementations§

§

impl Forget for Warning

§

impl Freeze for Warning
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze, String: Freeze,

§

impl Move for Warning

§

impl RefUnwindSafe for Warning

§

impl Send for Warning
where RawVecInner: Send, &'static str: Send, String: Send,

§

impl Sync for Warning
where RawVecInner: Sync, String: Sync,

§

impl Unpin for Warning
where *const u8 is !null: Unpin, &'static str: Unpin, String: Unpin,

§

impl UnsafeUnpin for Warning

§

impl UnwindSafe for Warning
where RawVecInner: UnwindSafe, &'static str: UnwindSafe, String: 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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> 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more