1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Precision change for intervals and bounds
//!
//! This module is in charge of handling the act of changing the precision of
//! intervals and bounds: (re-)_precising_.
//!
//! Precising intervals and bounds work differently depending
//! on their [`Relativity`](crate::intervals::meta::Relativity).
//!
//! For absolute structures, [`PreciseAbsInterval`] handles intervals,
//! [`PreciseAbsBound`] handles bounds.
//!
//! For relative structures, [`PreciseRelInterval`] handles intervals,
//! [`PreciseRelBound`] handles bounds.
//!
//! The precision itself is defined by [`Precision`](crate::ops::Precision).
//!
//! # Examples
//!
//! ```
//! # use std::error::Error;
//! # use std::time::Duration;
//! # use jiff::Zoned;
//! # use jiff::tz::TimeZone;
//! # use periodical::ops::{Precision, PrecisionMode};
//! # use periodical::intervals::absolute::{AbsBoundPair, AbsFiniteBoundPos};
//! # use periodical::intervals::ops::precision::PreciseAbsInterval;
//! let interval = AbsBoundPair::new(
//! AbsFiniteBoundPos::new(
//! "2025-01-01 08:03:29.591[Europe/Oslo]"
//! .parse::<Zoned>()?
//! .timestamp(),
//! )
//! .to_start_bound(),
//! AbsFiniteBoundPos::new(
//! "2025-01-01 15:57:44.041[Europe/Oslo]"
//! .parse::<Zoned>()?
//! .timestamp(),
//! )
//! .to_end_bound(),
//! );
//!
//! assert_eq!(
//! interval.precise(
//! TimeZone::get("Europe/Oslo")?,
//! Precision::new(Duration::from_mins(5), PrecisionMode::ToPast)?,
//! ),
//! Ok(AbsBoundPair::new(
//! AbsFiniteBoundPos::new(
//! "2025-01-01 08:00:00[Europe/Oslo]"
//! .parse::<Zoned>()?
//! .timestamp(),
//! )
//! .to_start_bound(),
//! AbsFiniteBoundPos::new(
//! "2025-01-01 15:55:00[Europe/Oslo]"
//! .parse::<Zoned>()?
//! .timestamp(),
//! )
//! .to_end_bound(),
//! )),
//! );
//! # Ok::<(), Box<dyn Error>>(())
//! ```
pub use ;
pub use ;