#[repr(i32)]pub enum JsonOmittable {
Unspecified = 0,
True = 1,
False = 2,
TrueButStillSerialize = 3,
}
Expand description
JsonOmittable is the notion of leaving out fields, and how we behave when a field is missing.
Variants§
Unspecified = 0
True = 1
If true the field will just be defaulted if not provided. The field will also not be serialized if its the default value.
False = 2
If false we will raise an error when the field is not provided.
TrueButStillSerialize = 3
Same as true, except always serialize the field even if its a default value.
Implementations§
Source§impl JsonOmittable
impl JsonOmittable
Source§impl JsonOmittable
impl JsonOmittable
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for JsonOmittable
impl Clone for JsonOmittable
Source§fn clone(&self) -> JsonOmittable
fn clone(&self) -> JsonOmittable
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsonOmittable
impl Debug for JsonOmittable
Source§impl Default for JsonOmittable
impl Default for JsonOmittable
Source§fn default() -> JsonOmittable
fn default() -> JsonOmittable
Returns the “default value” for a type. Read more
Source§impl From<JsonOmittable> for i32
impl From<JsonOmittable> for i32
Source§fn from(value: JsonOmittable) -> i32
fn from(value: JsonOmittable) -> i32
Converts to this type from the input type.
Source§impl Hash for JsonOmittable
impl Hash for JsonOmittable
Source§impl Ord for JsonOmittable
impl Ord for JsonOmittable
Source§fn cmp(&self, other: &JsonOmittable) -> Ordering
fn cmp(&self, other: &JsonOmittable) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for JsonOmittable
impl PartialEq for JsonOmittable
Source§impl PartialOrd for JsonOmittable
impl PartialOrd for JsonOmittable
Source§impl TryFrom<i32> for JsonOmittable
impl TryFrom<i32> for JsonOmittable
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
The type returned in the event of a conversion error.
Source§fn try_from(value: i32) -> Result<JsonOmittable, UnknownEnumValue>
fn try_from(value: i32) -> Result<JsonOmittable, UnknownEnumValue>
Performs the conversion.
impl Copy for JsonOmittable
impl Eq for JsonOmittable
impl StructuralPartialEq for JsonOmittable
Auto Trait Implementations§
impl Freeze for JsonOmittable
impl RefUnwindSafe for JsonOmittable
impl Send for JsonOmittable
impl Sync for JsonOmittable
impl Unpin for JsonOmittable
impl UnwindSafe for JsonOmittable
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