[−][src]Struct holding_kronos::Era
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,