Skip to main content

Field

Trait Field 

Source
pub trait Field: Sized + Default {
    // Required methods
    fn put(&self) -> Value;
    fn take(v: Option<&Value>) -> Self;
}
Expand description

a value that maps to one JSON member

Required Methods§

Source

fn put(&self) -> Value

Source

fn take(v: Option<&Value>) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Field for String

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for bool

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for i32

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for i64

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for u8

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for u16

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for u32

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl Field for u64

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl<T: Field> Field for BTreeMap<String, T>

a map with string keys as a JSON object (members in key order)

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl<T: Field> Field for Option<T>

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Source§

impl<T: Field> Field for Vec<T>

Source§

fn put(&self) -> Value

Source§

fn take(v: Option<&Value>) -> Self

Implementors§

Source§

impl Field for Value

a free-form member (configuration of a plugin, a service, …)