Lines Matching refs:nano
285 .and_then(|nano| NaiveTime::from_hms_nano_opt(hour, min, sec, nano)) in from_hms_milli_opt()
335 micro.checked_mul(1_000).and_then(|nano| NaiveTime::from_hms_nano_opt(hour, min, sec, nano)) in from_hms_micro_opt()
357 pub fn from_hms_nano(hour: u32, min: u32, sec: u32, nano: u32) -> NaiveTime { in from_hms_nano()
358 NaiveTime::from_hms_nano_opt(hour, min, sec, nano).expect("invalid time") in from_hms_nano()
384 pub fn from_hms_nano_opt(hour: u32, min: u32, sec: u32, nano: u32) -> Option<NaiveTime> { in from_hms_nano_opt()
385 if hour >= 24 || min >= 60 || sec >= 60 || nano >= 2_000_000_000 { in from_hms_nano_opt()
389 Some(NaiveTime { secs: secs, frac: nano }) in from_hms_nano_opt()
411 pub fn from_num_seconds_from_midnight(secs: u32, nano: u32) -> NaiveTime { in from_num_seconds_from_midnight()
412 NaiveTime::from_num_seconds_from_midnight_opt(secs, nano).expect("invalid time") in from_num_seconds_from_midnight()
436 pub fn from_num_seconds_from_midnight_opt(secs: u32, nano: u32) -> Option<NaiveTime> { in from_num_seconds_from_midnight_opt()
437 if secs >= 86_400 || nano >= 2_000_000_000 { in from_num_seconds_from_midnight_opt()
440 Some(NaiveTime { secs: secs, frac: nano }) in from_num_seconds_from_midnight_opt()
985 fn with_nanosecond(&self, nano: u32) -> Option<NaiveTime> { in with_nanosecond()
986 if nano >= 2_000_000_000 { in with_nanosecond()
989 Some(NaiveTime { frac: nano, ..*self }) in with_nanosecond()
1250 let (sec, nano) = if self.frac >= 1_000_000_000 { in fmt()
1257 if nano == 0 { in fmt()
1259 } else if nano % 1_000_000 == 0 { in fmt()
1260 write!(f, ".{:03}", nano / 1_000_000) in fmt()
1261 } else if nano % 1_000 == 0 { in fmt()
1262 write!(f, ".{:06}", nano / 1_000) in fmt()
1264 write!(f, ".{:09}", nano) in fmt()