icu_relativetime/
options.rs

1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5//! Options for configuring [`RelativeTimeFormatter`](crate::RelativeTimeFormatter).
6
7/// A bag of options for defining how to format time using
8/// [`RelativeTimeFormatter`](crate::RelativeTimeFormatter).
9#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)]
10pub struct RelativeTimeFormatterOptions {
11    /// Whether to always use numeric formatting for time.
12    pub numeric: Numeric,
13}
14
15/// Configures whether to always use numeric formatting even when special formatting is available.
16#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
17pub enum Numeric {
18    /// Always use numeric formatting.
19    #[default]
20    Always,
21
22    /// Automatically select special formatting if available else fallback to numeric formatting.
23    Auto,
24}