WarningKind

Enum WarningKind 

Source
pub enum WarningKind {
Show 14 variants CantInferTimezoneFromCountry(&'static str), ContainsEscapeCodes, Country(WarningKind), Decode(WarningKind), Deserialize(ParseError), InvalidLocationType, InvalidTimezone, InvalidTimezoneType, LocationCountryShouldBeAlpha3, NoLocationCountry, NoLocation, Parser(Error), ShouldBeAnObject, V221CdrHasLocationField,
}

Variants§

§

CantInferTimezoneFromCountry(&'static str)

A timezone can’t be inferred from the location’s country.

§

ContainsEscapeCodes

Neither the timezone or country field require char escape codes.

§

Country(WarningKind)

The CDR location is not a valid ISO 3166-1 alpha-3 code.

§

Decode(WarningKind)

The field at the path could not be decoded.

§

Deserialize(ParseError)

An error occurred while deserializing the CDR.

§

InvalidLocationType

The CDR location is not a String.

§

InvalidTimezone

The CDR location did not contain a valid IANA time-zone.

See: https://www.iana.org/time-zones.

§

InvalidTimezoneType

The CDR timezone is not a String.

§

LocationCountryShouldBeAlpha3

The location.country field should be an alpha-3 country code.

The alpha-2 code can be converted into an alpha-3 but the caller should be warned.

§

NoLocationCountry

The CDR’s location has no country element and so the timezone can’t be inferred.

§

NoLocation

The CDR has no location element and so the timezone can’t be found or inferred.

§

Parser(Error)

An Error occurred while parsing the JSON or deferred JSON String decode.

§

ShouldBeAnObject

Both the CDR and tariff JSON should be an Object.

§

V221CdrHasLocationField

A v221 CDR is given but it contains a location field instead of a cdr_location as defined in the spec.

Trait Implementations§

Source§

impl Debug for WarningKind

Source§

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

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

impl Display for WarningKind

Source§

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

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

impl From<WarningKind> for WarningKind

Source§

fn from(warn_kind: WarningKind) -> Self

Converts to this type from the input type.
Source§

impl From<WarningKind> for WarningKind

Source§

fn from(warn_kind: WarningKind) -> Self

Converts to this type from the input type.
Source§

impl Kind for WarningKind

Source§

fn id(&self) -> Cow<'static, str>

Return the human readable identifier for the Warning. Read more

Auto Trait Implementations§

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<K> IntoWarning<K> for K
where K: Kind,

Source§

fn into_warning(self, elem: &Element<'_>) -> Warning<K>

Convert a Kind into a Warning by supplying a json::Element.

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

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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