[][src]Enum fin_model::reporting::FinancialPeriod

pub enum FinancialPeriod {
    Quarter {
        quarter: u8,
        year: u16,
    },
    Half {
        half: u8,
        year: u16,
    },
    Year {
        year: u16,
    },
}

Represents common financial periods, whole years, half years, and quarter years.

By default the assumption is that periods represent calendar time; for example, the values "2019", "Q1 2019", and "H1 2019" are all assumed to start on January 1st.

Variants

Quarter

Fields of Quarter

quarter: u8

the quarter within the year (values: 1..4)

year: u16

the year itself (values: 1900..9999)

Half

Fields of Half

half: u8

the half of the year (values: 1..2)

year: u16

the year itself (values: 1900..9999)

Year

Fields of Year

year: u16

the year itself (values: 1900..9999)

Methods

impl FinancialPeriod[src]

pub fn is_valid(&self) -> bool[src]

Validate the period to ensure that quarter, half, and year values are within correct ranges.

Trait Implementations

impl PartialEq<FinancialPeriod> for FinancialPeriod[src]

impl Display for FinancialPeriod[src]

impl Debug for FinancialPeriod[src]

impl FromStr for FinancialPeriod[src]

type Err = ParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]