[−][src]Struct eu4save::Eu4Date
A date in EU4. It has no concept of leap years!
Implementations
impl Eu4Date
[src]
pub fn new(year: u16, month: u8, day: u8) -> Option<Self>
[src]
pub fn year(&self) -> u16
[src]
Year of the date
use eu4save::Eu4Date; let date = Eu4Date::parse_from_str("1445.02.03").expect("to parse date"); assert_eq!(date.year(), 1445);
pub fn month(&self) -> u8
[src]
Month of the date
use eu4save::Eu4Date; let date = Eu4Date::parse_from_str("1445.02.03").expect("to parse date"); assert_eq!(date.month(), 2);
pub fn day(&self) -> u8
[src]
Day of the date
use eu4save::Eu4Date; let date = Eu4Date::parse_from_str("1445.02.03").expect("to parse date"); assert_eq!(date.day(), 3);
pub fn parse_from_str<T: AsRef<str>>(s: T) -> Option<Self>
[src]
pub fn days(&self) -> i32
[src]
pub fn days_until(&self, other: &Eu4Date) -> i32
[src]
pub fn add_days(&self, days: i32) -> Eu4Date
[src]
pub fn from_i32(s: i32) -> Option<Self>
[src]
pub fn iso_8601(&self) -> String
[src]
pub fn eu4_fmt(&self) -> String
[src]
Trait Implementations
impl Clone for Eu4Date
[src]
impl Debug for Eu4Date
[src]
impl<'de> Deserialize<'de> for Eu4Date
[src]
fn deserialize<D>(deserializer: D) -> Result<Eu4Date, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Eu4Date
[src]
impl Ord for Eu4Date
[src]
fn cmp(&self, other: &Eu4Date) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Eu4Date> for Eu4Date
[src]
impl PartialOrd<Eu4Date> for Eu4Date
[src]
fn partial_cmp(&self, other: &Eu4Date) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Eu4Date
[src]
impl StructuralEq for Eu4Date
[src]
impl StructuralPartialEq for Eu4Date
[src]
Auto Trait Implementations
impl RefUnwindSafe for Eu4Date
impl Send for Eu4Date
impl Sync for Eu4Date
impl Unpin for Eu4Date
impl UnwindSafe for Eu4Date
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>,