optionable 0.14.0

Derive macro (and associated marker trait) to derive nested structs/enums with all subfields being optional (e.g. for patches or Kubernetes server side apply).
Documentation
use crate::optionable::impl_optional_self;
use crate::{Error, Optionable, OptionableConvert};
use chrono04::{DateTime, Days, Months, NaiveDate, NaiveDateTime, NaiveTime, TimeDelta, TimeZone};

impl<Tz: TimeZone> Optionable for DateTime<Tz> {
    type Optioned = Self;
}

impl<Tz: TimeZone> OptionableConvert for DateTime<Tz> {
    fn into_optioned(self) -> Self::Optioned {
        self
    }

    fn try_from_optioned(value: Self::Optioned) -> Result<Self, Error> {
        Ok(value)
    }

    fn merge(&mut self, other: Self::Optioned) -> Result<(), Error> {
        *self = other;
        Ok(())
    }
}

impl_optional_self!(Days, Months, NaiveDate, NaiveDateTime, NaiveTime, TimeDelta);