Skip to main content

FieldValue

Trait FieldValue 

Source
pub trait FieldValue: Sized {
    // Required methods
    fn kind() -> FieldKind;
    fn to_value(&self) -> Value;
    fn from_value(value: Value) -> Self;
}
Expand description

A Rust type a field can have.

Required Methods§

Source

fn kind() -> FieldKind

What it holds, unless the field’s attribute says otherwise.

Source

fn to_value(&self) -> Value

As a record holds it.

Source

fn from_value(value: Value) -> Self

From what a record holds. What cannot be read gives the type’s empty value.

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 FieldValue for DateTime

Source§

impl FieldValue for String

Source§

impl FieldValue for bool

Source§

impl FieldValue for f64

Source§

impl FieldValue for i32

Source§

impl FieldValue for i64

Source§

impl FieldValue for u32

Source§

impl FieldValue for u64

Source§

impl FieldValue for usize

Source§

impl<T: FieldValue> FieldValue for Option<T>

Implementors§