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
//! Library error type for `rusty-ts`.
//!
//! Per AD-009: library errors are typed via `thiserror`; the binary boundary
//! (`src/main.rs`) wraps these in `anyhow` for human-readable diagnostics.
//!
//! All public variants carry actionable context (offending input, source
//! error) rather than opaque strings. The enum is `#[non_exhaustive]` so new
//! variants can be added in minor versions without breaking semver per the
//! pre-1.0 evolution rules documented in `plan.md` §API Surface Summary.
use io;
/// Errors raised by the `rusty-ts` library API.
///
/// Marked `#[non_exhaustive]` to allow new variants in minor releases.
///
/// # Example
///
/// ```
/// use rusty_ts::{Error, TimestamperBuilder};
///
/// // Pattern-match on specific variants for actionable handling.
/// let result = TimestamperBuilder::new()
/// .utc(true)
/// .tz_name("Asia/Tokyo")
/// .build();
///
/// match result {
/// Err(Error::InvalidUtcWithNamedTz { tz }) => {
/// eprintln!("cannot combine -u with --tz={tz}");
/// }
/// Err(Error::InvalidIanaName(name)) => {
/// eprintln!("unknown IANA timezone: {name}");
/// }
/// Err(other) => eprintln!("error: {other}"),
/// Ok(_) => unreachable!("we configured a conflict"),
/// }
/// ```