Searched refs:StdDuration (Results 1 – 1 of 1) sorted by relevance
/external/rust/crates/chrono/src/ |
D | oldtime.rs | 14 use core::time::Duration as StdDuration; 278 pub fn from_std(duration: StdDuration) -> Result<Duration, OutOfRangeError> { in from_std() 294 pub fn to_std(&self) -> Result<StdDuration, OutOfRangeError> { in to_std() argument 298 Ok(StdDuration::new(self.secs as u64, self.nanos as u32)) in to_std() 459 use std::time::Duration as StdDuration; 651 assert_eq!(Duration::seconds(1).to_std(), Ok(StdDuration::new(1, 0))); in test_to_std() 652 assert_eq!(Duration::seconds(86401).to_std(), Ok(StdDuration::new(86401, 0))); in test_to_std() 653 assert_eq!(Duration::milliseconds(123).to_std(), Ok(StdDuration::new(0, 123000000))); in test_to_std() 654 assert_eq!(Duration::milliseconds(123765).to_std(), Ok(StdDuration::new(123, 765000000))); in test_to_std() 655 assert_eq!(Duration::nanoseconds(777).to_std(), Ok(StdDuration::new(0, 777))); in test_to_std() [all …]
|