[][src]Struct icu_datetime::date::MockDateTime

pub struct MockDateTime {
    pub year: usize,
    pub month: Month,
    pub day: Day,
    pub hour: Hour,
    pub minute: Minute,
    pub second: Second,
}

Temporary implementation of DateTimeType, which is used in tests, benchmarks and examples of this component.

Examples

use icu_datetime::date::MockDateTime;

let dt = MockDateTime::try_new(2020, 9, 24, 13, 21, 0)
    .expect("Failed to construct DateTime.");

Fields

year: usizemonth: Monthday: Dayhour: Hourminute: Minutesecond: Second

Implementations

impl MockDateTime[src]

pub const fn new(
    year: usize,
    month: Month,
    day: Day,
    hour: Hour,
    minute: Minute,
    second: Second
) -> Self
[src]

pub fn try_new(
    year: usize,
    month: usize,
    day: usize,
    hour: usize,
    minute: usize,
    second: usize
) -> Result<Self, DateTimeError>
[src]

Constructor for the MockDateTime.

Examples

use icu_datetime::date::MockDateTime;

let dt = MockDateTime::try_new(2020, 9, 24, 13, 21, 0)
    .expect("Failed to construct a DateTime");

Trait Implementations

impl DateTimeType for MockDateTime[src]

impl Debug for MockDateTime[src]

impl Default for MockDateTime[src]

impl FromStr for MockDateTime[src]

type Err = DateTimeError

The associated error which can be returned from parsing.

Auto Trait Implementations

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> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.