pub enum OptionValueModel {
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(String),
NonLiteral,
}Expand description
A graph-type constraint OPTIONS value. The canonical renderer
(canonical_option_value) maps the five literal kinds to text and
every other expression to ?; the model mirrors exactly that
distinction, so GraphTypeSpec::to_body reproduces the same
canonical rendering as the parsed source body.
Variants§
Null
Bool(bool)
Integer(i64)
Float(f64)
String(String)
NonLiteral
A non-literal OPTIONS expression: its canonical rendering is ?,
byte-identical to what the source expression canonicalized to.
Implementations§
Source§impl OptionValueModel
impl OptionValueModel
Sourcepub fn from_value(value: &Value) -> Self
pub fn from_value(value: &Value) -> Self
The one resolution-time Value → model conversion for a whole-map
OPTIONS $param: the five persisted literal kinds, and NonLiteral
for every other value — the model’s own vocabulary, so the resolver
never re-spells the match (Expr::from(&OptionValueModel::from_value(v))
renders the canonical ?).
Trait Implementations§
Source§impl Clone for OptionValueModel
impl Clone for OptionValueModel
Source§impl Debug for OptionValueModel
impl Debug for OptionValueModel
Source§impl<'de> Deserialize<'de> for OptionValueModel
impl<'de> Deserialize<'de> for OptionValueModel
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
Source§impl From<&Expr> for OptionValueModel
impl From<&Expr> for OptionValueModel
Source§impl From<&OptionValueModel> for Expr
impl From<&OptionValueModel> for Expr
Source§fn from(v: &OptionValueModel) -> Self
fn from(v: &OptionValueModel) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OptionValueModel
impl PartialEq for OptionValueModel
Source§impl Serialize for OptionValueModel
impl Serialize for OptionValueModel
impl StructuralPartialEq for OptionValueModel
Auto Trait Implementations§
impl Forget for OptionValueModel
impl Freeze for OptionValueModel
impl Move for OptionValueModel
impl RefUnwindSafe for OptionValueModel
impl Send for OptionValueModelwhere
RawVecInner: Send,
impl Sync for OptionValueModelwhere
RawVecInner: Sync,
impl Unpin for OptionValueModel
impl UnsafeUnpin for OptionValueModel
impl UnwindSafe for OptionValueModelwhere
RawVecInner: 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