[][src]Struct holding_kronos::Era

pub struct Era {
    pub name: String,
    pub start_year: Option<i64>,
    pub end_year: Option<i64>,
}

An era is a contiguous block of time in a calendar from which time can be referenced. Multiple eras can exist (and overlap) simultaneously, making it a very flexible tool for spacing out chunks of time such as reigning monarchs, or warring gods.

An era that is unbounded on the left (ie. has no start) is considered to have always existed, while an era that is unbounded on the right right has not ended.

Fields

name: String

The name of the Era.

start_year: Option<i64>

When the era started. None implies it has always existed.

end_year: Option<i64>

When the era ended. None implies it hasn't ended.

Implementations

impl Era[src]

pub fn new(name: String, start_year: Option<i64>, end_year: Option<i64>) -> Self[src]

Creates a new Era.

pub fn name(&self) -> &str[src]

Gets the name of the Era.

pub fn start_year(&self) -> Option<i64>[src]

Gets the start year of the Era.

pub fn end_year(&self) -> Option<i64>[src]

Gets the end year of the Era.

Trait Implementations

impl Clone for Era[src]

impl Debug for Era[src]

impl<'de> Deserialize<'de> for Era[src]

impl Serialize for Era[src]

Auto Trait Implementations

impl RefUnwindSafe for Era

impl Send for Era

impl Sync for Era

impl Unpin for Era

impl UnwindSafe for Era

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.