Struct chrono::naive::time::NaiveTime [-] [+] [src]

pub struct NaiveTime {
    // some fields omitted
}

ISO 8601 time without timezone. Allows for the nanosecond precision and optional leap second representation.

Methods

impl NaiveTime

fn from_hms(hour: u32, min: u32, sec: u32) -> NaiveTime

Makes a new NaiveTime from hour, minute and second.

Fails on invalid hour, minute and/or second.

fn from_hms_opt(hour: u32, min: u32, sec: u32) -> Option<NaiveTime>

Makes a new NaiveTime from hour, minute and second.

Returns None on invalid hour, minute and/or second.

fn from_hms_milli(hour: u32, min: u32, sec: u32, milli: u32) -> NaiveTime

Makes a new NaiveTime from hour, minute, second and millisecond. The millisecond part can exceed 1,000 in order to represent the leap second.

Fails on invalid hour, minute, second and/or millisecond.

fn from_hms_milli_opt(hour: u32, min: u32, sec: u32, milli: u32) -> Option<NaiveTime>

Makes a new NaiveTime from hour, minute, second and millisecond. The millisecond part can exceed 1,000 in order to represent the leap second.

Returns None on invalid hour, minute, second and/or millisecond.

fn from_hms_micro(hour: u32, min: u32, sec: u32, micro: u32) -> NaiveTime

Makes a new NaiveTime from hour, minute, second and microsecond. The microsecond part can exceed 1,000,000 in order to represent the leap second.

Fails on invalid hour, minute, second and/or microsecond.

fn from_hms_micro_opt(hour: u32, min: u32, sec: u32, micro: u32) -> Option<NaiveTime>

Makes a new NaiveTime from hour, minute, second and microsecond. The microsecond part can exceed 1,000,000 in order to represent the leap second.

Returns None on invalid hour, minute, second and/or microsecond.

fn from_hms_nano(hour: u32, min: u32, sec: u32, nano: u32) -> NaiveTime

Makes a new NaiveTime from hour, minute, second and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.

Fails on invalid hour, minute, second and/or nanosecond.

fn from_hms_nano_opt(hour: u32, min: u32, sec: u32, nano: u32) -> Option<NaiveTime>

Makes a new NaiveTime from hour, minute, second and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.

Returns None on invalid hour, minute, second and/or nanosecond.

fn from_num_seconds_from_midnight(secs: u32, nano: u32) -> NaiveTime

Makes a new NaiveTime from the number of seconds since midnight and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.

Fails on invalid number of seconds and/or nanosecond.

fn from_num_seconds_from_midnight_opt(secs: u32, nano: u32) -> Option<NaiveTime>

Makes a new NaiveTime from the number of seconds since midnight and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.

Returns None on invalid number of seconds and/or nanosecond.

fn parse_from_str(s: &str, fmt: &str) -> ParseResult<NaiveTime>

Parses a string with the specified format string and returns a new NaiveTime. See the format::strftime module on the supported escape sequences.

fn format_with_items<'a, I>(&self, items: I) -> DelayedFormat<I> where I: Iterator<Item=Item<'a>> + Clone

Formats the time with the specified formatting items.

fn format<'a>(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>

Formats the time with the specified format string. See the format::strftime module on the supported escape sequences.

Trait Implementations

impl Timelike for NaiveTime

fn hour(&self) -> u32

fn minute(&self) -> u32

fn second(&self) -> u32

fn nanosecond(&self) -> u32

fn with_hour(&self, hour: u32) -> Option<NaiveTime>

fn with_minute(&self, min: u32) -> Option<NaiveTime>

fn with_second(&self, sec: u32) -> Option<NaiveTime>

fn with_nanosecond(&self, nano: u32) -> Option<NaiveTime>

fn num_seconds_from_midnight(&self) -> u32

fn hour12(&self) -> (bool, u32)

impl Hash for NaiveTime

fn hash<H: Hasher>(&self, state: &mut H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Add<Duration> for NaiveTime

type Output = NaiveTime

fn add(self, rhs: Duration) -> NaiveTime

impl Sub<NaiveTime> for NaiveTime

type Output = Duration

fn sub(self, rhs: NaiveTime) -> Duration

impl Sub<Duration> for NaiveTime

type Output = NaiveTime

fn sub(self, rhs: Duration) -> NaiveTime

impl Debug for NaiveTime

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for NaiveTime

fn fmt(&self, f: &mut Formatter) -> Result

impl FromStr for NaiveTime

type Err = ParseError

fn from_str(s: &str) -> ParseResult<NaiveTime>

Derived Implementations

impl Clone for NaiveTime

fn clone(&self) -> NaiveTime

fn clone_from(&mut self, source: &Self)

impl Copy for NaiveTime

impl Ord for NaiveTime

fn cmp(&self, __arg_0: &NaiveTime) -> Ordering

impl PartialOrd for NaiveTime

fn partial_cmp(&self, __arg_0: &NaiveTime) -> Option<Ordering>

fn lt(&self, __arg_0: &NaiveTime) -> bool

fn le(&self, __arg_0: &NaiveTime) -> bool

fn gt(&self, __arg_0: &NaiveTime) -> bool

fn ge(&self, __arg_0: &NaiveTime) -> bool

impl Eq for NaiveTime

fn assert_receiver_is_total_eq(&self)

impl PartialEq for NaiveTime

fn eq(&self, __arg_0: &NaiveTime) -> bool

fn ne(&self, __arg_0: &NaiveTime) -> bool