pub enum OptionalBody<T> {
Default,
Missing,
Body(T),
}
Expand description
A generic container type for distinguishing between
a missing key, an explicitly null key, and an explicit value T
.
This is needed for modeling on:
triggers, since GitHub distinguishes
between the non-presence of an event (no trigger) and the presence
of an empty event body (e.g. pull_request:
), which means “trigger
with the defaults for this event type.”
Variants§
Trait Implementations§
Source§impl<T> Default for OptionalBody<T>
impl<T> Default for OptionalBody<T>
Source§fn default() -> OptionalBody<T>
fn default() -> OptionalBody<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for OptionalBody<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for OptionalBody<T>where
T: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for OptionalBody<T>where
T: Freeze,
impl<T> RefUnwindSafe for OptionalBody<T>where
T: RefUnwindSafe,
impl<T> Send for OptionalBody<T>where
T: Send,
impl<T> Sync for OptionalBody<T>where
T: Sync,
impl<T> Unpin for OptionalBody<T>where
T: Unpin,
impl<T> UnwindSafe for OptionalBody<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more