• Home
  • Raw
  • Download

Lines Matching refs:LocalResult

30 pub enum LocalResult<T> {  enum
41 impl<T> LocalResult<T> { implementation
45 LocalResult::Single(t) => Some(t), in single()
53 LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => Some(t), in earliest()
61 LocalResult::Single(t) | LocalResult::Ambiguous(_, t) => Some(t), in latest()
67 pub fn map<U, F: FnMut(T) -> U>(self, mut f: F) -> LocalResult<U> { in map()
69 LocalResult::None => LocalResult::None, in map()
70 LocalResult::Single(v) => LocalResult::Single(f(v)), in map()
71 LocalResult::Ambiguous(min, max) => LocalResult::Ambiguous(f(min), f(max)), in map()
76 impl<Tz: TimeZone> LocalResult<Date<Tz>> { impl
82 pub fn and_time(self, time: NaiveTime) -> LocalResult<DateTime<Tz>> { in and_time()
84 LocalResult::Single(d) => { in and_time()
85 d.and_time(time).map_or(LocalResult::None, LocalResult::Single) in and_time()
87 _ => LocalResult::None, in and_time()
96 pub fn and_hms_opt(self, hour: u32, min: u32, sec: u32) -> LocalResult<DateTime<Tz>> { in and_hms_opt()
98 LocalResult::Single(d) => { in and_hms_opt()
99 d.and_hms_opt(hour, min, sec).map_or(LocalResult::None, LocalResult::Single) in and_hms_opt()
101 _ => LocalResult::None, in and_hms_opt()
117 ) -> LocalResult<DateTime<Tz>> { in and_hms_milli_opt()
119 LocalResult::Single(d) => d in and_hms_milli_opt()
121 .map_or(LocalResult::None, LocalResult::Single), in and_hms_milli_opt()
122 _ => LocalResult::None, in and_hms_milli_opt()
138 ) -> LocalResult<DateTime<Tz>> { in and_hms_micro_opt()
140 LocalResult::Single(d) => d in and_hms_micro_opt()
142 .map_or(LocalResult::None, LocalResult::Single), in and_hms_micro_opt()
143 _ => LocalResult::None, in and_hms_micro_opt()
159 ) -> LocalResult<DateTime<Tz>> { in and_hms_nano_opt()
161 LocalResult::Single(d) => d in and_hms_nano_opt()
163 .map_or(LocalResult::None, LocalResult::Single), in and_hms_nano_opt()
164 _ => LocalResult::None, in and_hms_nano_opt()
169 impl<T: fmt::Debug> LocalResult<T> { impl
173 LocalResult::None => panic!("No such local time"), in unwrap()
174 LocalResult::Single(t) => t, in unwrap()
175 LocalResult::Ambiguous(t1, t2) => { in unwrap()
233 fn ymd_opt(&self, year: i32, month: u32, day: u32) -> LocalResult<Date<Self>> { in ymd_opt()
236 None => LocalResult::None, in ymd_opt()
266 fn yo_opt(&self, year: i32, ordinal: u32) -> LocalResult<Date<Self>> { in yo_opt()
269 None => LocalResult::None, in yo_opt()
303 fn isoywd_opt(&self, year: i32, week: u32, weekday: Weekday) -> LocalResult<Date<Self>> { in isoywd_opt()
306 None => LocalResult::None, in isoywd_opt()
334 fn timestamp_opt(&self, secs: i64, nsecs: u32) -> LocalResult<DateTime<Self>> { in timestamp_opt()
336 Some(dt) => LocalResult::Single(self.from_utc_datetime(&dt)), in timestamp_opt()
337 None => LocalResult::None, in timestamp_opt()
375 fn timestamp_millis_opt(&self, millis: i64) -> LocalResult<DateTime<Self>> { in timestamp_millis_opt()
426 fn offset_from_local_date(&self, local: &NaiveDate) -> LocalResult<Self::Offset>; in offset_from_local_date()
429 fn offset_from_local_datetime(&self, local: &NaiveDateTime) -> LocalResult<Self::Offset>; in offset_from_local_datetime()
432 fn from_local_date(&self, local: &NaiveDate) -> LocalResult<Date<Self>> { in from_local_date()
440 fn from_local_datetime(&self, local: &NaiveDateTime) -> LocalResult<DateTime<Self>> { in from_local_datetime()
503 LocalResult::Single(dt) => { in test_negative_millis()