Lines Matching refs:seconds

74         Duration::seconds(secs)  in weeks()
83 Duration::seconds(secs) in days()
92 Duration::seconds(secs) in hours()
101 Duration::seconds(secs) in minutes()
108 pub fn seconds(seconds: i64) -> Duration { in seconds() method
109 let d = Duration { secs: seconds, nanos: 0 }; in seconds()
464 assert!(Duration::seconds(1) != Duration::zero()); in test_duration()
465 assert_eq!(Duration::seconds(1) + Duration::seconds(2), Duration::seconds(3)); in test_duration()
467 Duration::seconds(86399) + Duration::seconds(4), in test_duration()
468 Duration::days(1) + Duration::seconds(3) in test_duration()
470 assert_eq!(Duration::days(10) - Duration::seconds(1000), Duration::seconds(863000)); in test_duration()
471 assert_eq!(Duration::days(10) - Duration::seconds(1000000), Duration::seconds(-136000)); in test_duration()
473 Duration::days(2) + Duration::seconds(86399) + Duration::nanoseconds(1234567890), in test_duration()
478 -(Duration::days(3) + Duration::seconds(70)), in test_duration()
479 Duration::days(-4) + Duration::seconds(86400 - 70) in test_duration()
488 assert_eq!(Duration::seconds(86399).num_days(), 0); in test_duration_num_days()
489 assert_eq!(Duration::seconds(86401).num_days(), 1); in test_duration_num_days()
490 assert_eq!(Duration::seconds(-86399).num_days(), 0); in test_duration_num_days()
491 assert_eq!(Duration::seconds(-86401).num_days(), -1); in test_duration_num_days()
499 assert_eq!(Duration::seconds(1).num_seconds(), 1); in test_duration_num_seconds()
500 assert_eq!(Duration::seconds(-1).num_seconds(), -1); in test_duration_num_seconds()
597 assert_eq!(Duration::nanoseconds(1) * 1_000_000_000, Duration::seconds(1)); in test_duration_mul()
598 assert_eq!(Duration::nanoseconds(1) * -1_000_000_000, -Duration::seconds(1)); in test_duration_mul()
599 assert_eq!(-Duration::nanoseconds(1) * 1_000_000_000, -Duration::seconds(1)); in test_duration_mul()
602 Duration::seconds(10) - Duration::nanoseconds(10) in test_duration_mul()
605 (Duration::nanoseconds(1) + Duration::seconds(1) + Duration::days(1)) * 3, in test_duration_mul()
606 Duration::nanoseconds(3) + Duration::seconds(3) + Duration::days(3) in test_duration_mul()
608 assert_eq!(Duration::milliseconds(1500) * -2, Duration::seconds(-3)); in test_duration_mul()
609 assert_eq!(Duration::milliseconds(-1500) * 2, Duration::seconds(-3)); in test_duration_mul()
620 assert_eq!(Duration::seconds(1) / 3, Duration::nanoseconds(333_333_333)); in test_duration_div()
621 assert_eq!(Duration::seconds(4) / 3, Duration::nanoseconds(1_333_333_333)); in test_duration_div()
622 assert_eq!(Duration::seconds(-1) / 2, Duration::milliseconds(-500)); in test_duration_div()
623 assert_eq!(Duration::seconds(1) / -2, Duration::milliseconds(-500)); in test_duration_div()
624 assert_eq!(Duration::seconds(-1) / -2, Duration::milliseconds(500)); in test_duration_div()
625 assert_eq!(Duration::seconds(-4) / 3, Duration::nanoseconds(-1_333_333_333)); in test_duration_div()
626 assert_eq!(Duration::seconds(-4) / -3, Duration::nanoseconds(1_333_333_333)); in test_duration_div()
634 assert_eq!(Duration::seconds(42).to_string(), "PT42S"); in test_duration_fmt()
639 assert_eq!(Duration::seconds(-86401).to_string(), "-P1DT1S"); in test_duration_fmt()
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()
657 assert_eq!(Duration::seconds(-1).to_std(), Err(OutOfRangeError(()))); in test_to_std()
663 assert_eq!(Ok(Duration::seconds(1)), Duration::from_std(StdDuration::new(1, 0))); in test_from_std()
664 assert_eq!(Ok(Duration::seconds(86401)), Duration::from_std(StdDuration::new(86401, 0))); in test_from_std()