Skip to main content

IntoLiteral

Trait IntoLiteral 

Source
pub trait IntoLiteral: Clone + 'static {
    type Output: Clone + PartialEq + Debug;

    // Required methods
    fn to_json_value(&self) -> Value;
    fn extract(value: &Value) -> Option<Self::Output>;
    fn display(&self) -> String;
}
Expand description

Trait for types that can be used as literal values.

Required Associated Types§

Required Methods§

Source

fn to_json_value(&self) -> Value

Source

fn extract(value: &Value) -> Option<Self::Output>

Source

fn display(&self) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoLiteral for &'static str

Source§

impl IntoLiteral for bool

Source§

impl IntoLiteral for f64

Source§

impl IntoLiteral for i64

Source§

impl IntoLiteral for String

Implementors§