pub struct Birthday {
pub year: Option<u16>,
pub month: Option<u8>,
pub day: Option<u8>,
}Expand description
NIP-24 birthday object.
All three components are independently optional: a profile MAY publish
only month + day to celebrate without revealing the year, only
year + month for approximate birthdays, or any other subset.
The struct is Copy because it carries only small integer fields;
the field types (u16 for year, u8 for month/day) reject obvious
out-of-range values at deserialisation time without extra guards.
Fields§
§year: Option<u16>Birth year (e.g. 1990). Range is not further constrained
because the spec leaves future-dated profiles to application
policy.
month: Option<u8>Birth month (1–12 when present; values outside that range are allowed to round-trip but should be rejected at application level).
day: Option<u8>Birth day of month (1–31 when present; application layer is responsible for month-specific validation).
Implementations§
Trait Implementations§
impl Copy for Birthday
Source§impl<'de> Deserialize<'de> for Birthday
impl<'de> Deserialize<'de> for Birthday
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Birthday
impl StructuralPartialEq for Birthday
Auto Trait Implementations§
impl Freeze for Birthday
impl RefUnwindSafe for Birthday
impl Send for Birthday
impl Sync for Birthday
impl Unpin for Birthday
impl UnsafeUnpin for Birthday
impl UnwindSafe for Birthday
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.