[−][src]Struct iso15924::ScriptDate
Representation of a date of introduction for a script code. This contains
year
, month
, and day
public fields of u16
type.
Examples
Create a new valid ScriptDate
:
use iso15924::ScriptDate; let _ = ScriptDate::new(1976, 7, 2);
Check if a ScriptDate
is equal to, less than, etc. another ScriptDate
:
use iso15924::ScriptDate; let date1 = ScriptDate::new(1997, 7, 7); let date2 = ScriptDate::new(2005, 5, 5); // Check that `date1` is not equal to `date2`. assert_ne!(date1, date2); // Check that `date1` is less than `date2`. assert!(date1 < date2); // Check that `date2` is greater than `date1`. assert!(date2 > date1);
Fields
year: u16
The year of the date that a code was introduced.
month: u8
The month of the date that a code was introduced.
day: u8
The day of the date that a code was introduced.
Methods
impl ScriptDate
[src]
pub const fn new(year: u16, month: u8, day: u8) -> Self
[src]
Creates a new ScriptDate
from the given year
, month
, and day
, if
possible.
This doesn't check the input for a valid month and day. If you need
that, use the TryFrom
impl.
Examples
Create a new valid ScriptDate
:
use iso15924::ScriptDate; let _ = ScriptDate::new(2000, 1, 1);
Trait Implementations
impl Clone for ScriptDate
[src]
fn clone(&self) -> ScriptDate
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ScriptDate
[src]
impl Eq for ScriptDate
[src]
impl Ord for ScriptDate
[src]
fn cmp(&self, other: &ScriptDate) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ScriptDate> for ScriptDate
[src]
impl PartialOrd<ScriptDate> for ScriptDate
[src]
fn partial_cmp(&self, other: &ScriptDate) -> Option<Ordering>
[src]
fn lt(&self, other: &ScriptDate) -> bool
[src]
fn le(&self, other: &ScriptDate) -> bool
[src]
fn gt(&self, other: &ScriptDate) -> bool
[src]
fn ge(&self, other: &ScriptDate) -> bool
[src]
impl Debug for ScriptDate
[src]
impl TryFrom<(u16, u8, u8)> for ScriptDate
[src]
type Error = ScriptDateError
The type returned in the event of a conversion error.
fn try_from((year, month, day): (u16, u8, u8)) -> Result<Self, Self::Error>
[src]
impl FromStr for ScriptDate
[src]
type Err = ScriptDateError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for ScriptDate
[src]
Auto Trait Implementations
impl Send for ScriptDate
impl Sync for ScriptDate
impl Unpin for ScriptDate
impl UnwindSafe for ScriptDate
impl RefUnwindSafe for ScriptDate
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,