pub enum OptionValue {
Bool(bool),
Number(f64),
Str(String),
}Expand description
An option’s value, as the source wrote it.
The canonical OptionValue union also admits a nested map, and no
input produces one: an aggregate value (option (f) = { a: 1 };) is
kept as the text between its braces, as protoc records it (every
comment turned to the spaces and newlines that hold the layout; see
aggregate.rs), so the three variants here are the whole range the
walk emits.
Variants§
Bool(bool)
Number(f64)
A numeric constant, read exactly as JavaScript’s Number() reads
it. Serializes as null when the source names a value no JSON
number can hold, which is what JSON.stringify writes for NaN
and the infinities.
Str(String)
Trait Implementations§
Source§impl Clone for OptionValue
impl Clone for OptionValue
Source§impl Debug for OptionValue
impl Debug for OptionValue
Source§impl PartialEq for OptionValue
impl PartialEq for OptionValue
Source§impl Serialize for OptionValue
impl Serialize for OptionValue
impl StructuralPartialEq for OptionValue
Auto Trait Implementations§
impl Forget for OptionValue
impl Freeze for OptionValue
impl RefUnwindSafe for OptionValue
impl Send for OptionValue
impl Sync for OptionValue
impl Unpin for OptionValue
impl UnsafeUnpin for OptionValue
impl UnwindSafe for OptionValue
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