lexical_parse_integer/
options.rs1use lexical_util::options::ParseOptions;
4use lexical_util::result::Result;
5use static_assertions::const_assert;
6
7#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
9pub struct OptionsBuilder {}
10
11impl OptionsBuilder {
12 #[inline(always)]
14 pub const fn new() -> Self {
15 Self {}
16 }
17
18 #[inline(always)]
22 pub const fn is_valid(&self) -> bool {
23 true
24 }
25
26 #[inline(always)]
32 pub const unsafe fn build_unchecked(&self) -> Options {
33 Options {}
34 }
35
36 #[inline(always)]
38 pub const fn build(&self) -> Result<Options> {
39 Ok(unsafe { self.build_unchecked() })
41 }
42}
43
44impl Default for OptionsBuilder {
45 #[inline(always)]
46 fn default() -> Self {
47 Self::new()
48 }
49}
50
51#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
65pub struct Options {}
66
67impl Options {
68 #[inline(always)]
70 pub const fn new() -> Self {
71 Self {}
72 }
73
74 #[inline(always)]
76 pub const fn is_valid(&self) -> bool {
77 true
78 }
79
80 #[inline(always)]
84 pub const fn builder() -> OptionsBuilder {
85 OptionsBuilder::new()
86 }
87
88 #[inline(always)]
90 pub const fn rebuild(&self) -> OptionsBuilder {
91 OptionsBuilder {}
92 }
93}
94
95impl Default for Options {
96 #[inline(always)]
97 fn default() -> Self {
98 Self::new()
99 }
100}
101
102impl ParseOptions for Options {
103 #[inline(always)]
104 fn is_valid(&self) -> bool {
105 Self::is_valid(self)
106 }
107}
108
109#[rustfmt::skip]
114pub const STANDARD: Options = Options::new();
115const_assert!(STANDARD.is_valid());