• Home
  • Raw
  • Download

Lines Matching refs:Of

268 pub struct Of(pub u32);  struct
270 impl Of { impl
281 pub fn new(ordinal: u32, YearFlags(flags): YearFlags) -> Of { in new() argument
282 let ordinal = Of::clamp_ordinal(ordinal); in new()
283 Of((ordinal << 4) | u32::from(flags)) in new()
287 pub fn from_mdf(Mdf(mdf): Mdf) -> Of { in from_mdf() argument
290 Some(&v) => Of(mdf.wrapping_sub((i32::from(v) as u32 & 0x3ff) << 3)), in from_mdf()
291 None => Of(0), in from_mdf()
297 let Of(of) = *self; in valid() localVariable
304 let Of(of) = *self; in ordinal() localVariable
309 pub fn with_ordinal(&self, ordinal: u32) -> Of { in with_ordinal() argument
310 let ordinal = Of::clamp_ordinal(ordinal); in with_ordinal()
311 let Of(of) = *self; in with_ordinal() localVariable
312 Of((of & 0b1111) | (ordinal << 4)) in with_ordinal()
317 let Of(of) = *self; in flags() localVariable
322 pub fn with_flags(&self, YearFlags(flags): YearFlags) -> Of { in with_flags() argument
323 let Of(of) = *self; in with_flags() localVariable
324 Of((of & !0b1111) | u32::from(flags)) in with_flags()
329 let Of(of) = *self; in weekday() localVariable
336 let Of(of) = *self; in isoweekdate_raw() localVariable
347 pub fn succ(&self) -> Of { in succ() argument
348 let Of(of) = *self; in succ() localVariable
349 Of(of + (1 << 4)) in succ()
353 pub fn pred(&self) -> Of { in pred() argument
354 let Of(of) = *self; in pred() localVariable
355 Of(of - (1 << 4)) in pred()
359 impl fmt::Debug for Of { implementation
361 let Of(of) = *self; in fmt() localVariable
407 pub fn from_of(Of(of): Of) -> Mdf { in from_of()
464 pub fn to_of(&self) -> Of { in to_of() argument
465 Of::from_mdf(*self) in to_of()
489 use super::{Mdf, Of};
537 let of = Of::new(ordinal, flags); in test_of()
654 let of = Of::new(ordinal, flags); in test_of_fields()
665 let of = Of::new(ordinal, flags); in test_of_with_fields()
669 assert_eq!(of.valid(), Of::new(ordinal, flags).valid()); in test_of_with_fields()
688 assert_eq!(Of::new(1, A).weekday(), Weekday::Sun); in test_of_weekday()
689 assert_eq!(Of::new(1, B).weekday(), Weekday::Sat); in test_of_weekday()
690 assert_eq!(Of::new(1, C).weekday(), Weekday::Fri); in test_of_weekday()
691 assert_eq!(Of::new(1, D).weekday(), Weekday::Thu); in test_of_weekday()
692 assert_eq!(Of::new(1, E).weekday(), Weekday::Wed); in test_of_weekday()
693 assert_eq!(Of::new(1, F).weekday(), Weekday::Tue); in test_of_weekday()
694 assert_eq!(Of::new(1, G).weekday(), Weekday::Mon); in test_of_weekday()
695 assert_eq!(Of::new(1, AG).weekday(), Weekday::Sun); in test_of_weekday()
696 assert_eq!(Of::new(1, BA).weekday(), Weekday::Sat); in test_of_weekday()
697 assert_eq!(Of::new(1, CB).weekday(), Weekday::Fri); in test_of_weekday()
698 assert_eq!(Of::new(1, DC).weekday(), Weekday::Thu); in test_of_weekday()
699 assert_eq!(Of::new(1, ED).weekday(), Weekday::Wed); in test_of_weekday()
700 assert_eq!(Of::new(1, FE).weekday(), Weekday::Tue); in test_of_weekday()
701 assert_eq!(Of::new(1, GF).weekday(), Weekday::Mon); in test_of_weekday()
704 let mut prev = Of::new(1, flags).weekday(); in test_of_weekday()
706 let of = Of::new(ordinal, flags); in test_of_weekday()
775 let (week, _) = Of::new(4 /* January 4 */, flags).isoweekdate_raw(); in test_of_isoweekdate_raw()
783 let of = Of(i); in test_of_to_mdf()
799 let of = Of(i); in test_of_to_mdf_to_of()