Lines Matching +full:rkyv +full:- +full:validation
3 #[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))]
4 use rkyv::{Archive, Deserialize, Serialize};
33 #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))]
35 any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"),
40 #[cfg_attr(feature = "rkyv-validation", archive(check_bytes))]
63 /// ----------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
67 pub const fn succ(&self) -> Weekday { in succ()
82 /// ----------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
86 pub const fn pred(&self) -> Weekday { in pred()
98 /// Returns a day-of-week number starting from Monday = 1. (ISO 8601 weekday number)
101 /// ------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
104 pub const fn number_from_monday(&self) -> u32 { in number_from_monday()
108 /// Returns a day-of-week number starting from Sunday = 1.
111 /// ------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
114 pub const fn number_from_sunday(&self) -> u32 { in number_from_sunday()
118 /// Returns a day-of-week number starting from Monday = 0.
121 /// --------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
129 /// // MTWRFSU is occasionally used as a single-letter abbreviation of the weekdays.
137 pub const fn num_days_from_monday(&self) -> u32 { in num_days_from_monday()
141 /// Returns a day-of-week number starting from Sunday = 0.
144 /// --------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
147 pub const fn num_days_from_sunday(&self) -> u32 { in num_days_from_sunday()
151 /// Returns a day-of-week number starting from the parameter `day` (D) = 0.
154 /// --------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | -----
157 pub(crate) const fn num_days_from(&self, day: Weekday) -> u32 { in num_days_from()
158 (*self as u32 + 7 - day as u32) % 7 in num_days_from()
163 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
182 fn try_from(value: u8) -> Result<Self, Self::Error> { in try_from()
201 fn from_i64(n: i64) -> Option<Weekday> { in from_i64()
215 fn from_u64(n: u64) -> Option<Weekday> { in from_u64()
239 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
245 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
259 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> in serialize()
272 fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { in expecting()
276 fn visit_str<E>(self, value: &str) -> Result<Self::Value, E> in visit_str()
285 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> in deserialize()
391 #[cfg(feature = "rkyv-validation")]
394 let bytes = rkyv::to_bytes::<_, 1>(&mon).unwrap(); in test_rkyv_validation()
396 assert_eq!(rkyv::from_bytes::<Weekday>(&bytes).unwrap(), mon); in test_rkyv_validation()