Skip to main content

Warning

Enum Warning 

Source
pub enum Warning {
    Country(Warning),
    CountryShouldBeAlpha2,
    Currency(Warning),
    DateTime(Warning),
    Decode(Warning),
    Duration(Warning),
    Money(Warning),
    NoPeriods,
    Number(Warning),
    PeriodsOutsideStartEndDateTime {
        cdr_range: Range<Timestamp>,
        period_range: PeriodRange,
    },
    String(Warning),
    Rejected,
}
Expand description

The faults build finds in a CDR’s values, such as a malformed timestamp or a CDR without charging periods.

The faults in the CDR’s structure are the schema::Warnings that check returns. A fault in the values of a tariff the CDR contains is a tariff::Warning, which Cdr::tariffs returns.

Variants§

§

Country(Warning)

Raised while reading a country code.

§

CountryShouldBeAlpha2

The $.country_code field names an alpha-3 code where OCPI defines it as alpha-2.

The alpha-3 is read and converted to its alpha-2, so the CDR still prices. Only the CDR’s own $.country_code raises this. A location.country is alpha-3 by definition and reports timezone::Warning::LocationCountryShouldBeAlpha3 instead.

§

Currency(Warning)

Raised while reading a 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.

§

Money(Warning)

Raised while reading a price.

§

NoPeriods

The CDR has no charging periods.

§

Number(Warning)

Raised while reading a number.

§

PeriodsOutsideStartEndDateTime

The start_date_time of at least one of the charging_periods is outside of the CDR’s start_date_time-end_date_time range.

Fields

§cdr_range: Range<Timestamp>

The session’s own start and end, taken from the CDR.

§period_range: PeriodRange

The range the charging periods actually span.

§

String(Warning)

Raised while reading a string.

§

Rejected

A required field of a CDR object was missing or invalid, so the object couldn’t be read. The schema warnings locate the cause (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,

§

impl Move for Warning

§

impl RefUnwindSafe for Warning

§

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

§

impl Sync for Warning
where RawVecInner: Sync,

§

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

§

impl UnsafeUnpin for Warning

§

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