Skip to main content

FieldType

Trait FieldType 

Source
pub trait FieldType {
    const KIND: FieldKind;
    const OPTIONAL: bool = false;

    // Required method
    fn to_value(&self) -> Value;
}
Expand description

Types that can be model fields.

Required Associated Constants§

Provided Associated Constants§

Source

const OPTIONAL: bool = false

Whether the field may be empty (Option<T>).

Required Methods§

Source

fn to_value(&self) -> 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 FieldType for String

Source§

const KIND: FieldKind = FieldKind::Text

Source§

fn to_value(&self) -> Value

Source§

impl FieldType for Vec<File>

Several uploaded files, such as the attachments of a ticket.

Source§

impl FieldType for Vec<f64>

A series of numbers kept in one field, such as the last weeks of sales of a product, for sparkline cells. Stored as JSON.

Source§

impl FieldType for Vec<i64>

Several ids chosen in a lookup, such as the tags of a product.

Source§

impl FieldType for bool

Source§

const KIND: FieldKind = FieldKind::Bool

Source§

fn to_value(&self) -> Value

Source§

impl FieldType for i32

Source§

const KIND: FieldKind = FieldKind::Integer

Source§

fn to_value(&self) -> Value

Source§

impl FieldType for i64

Source§

const KIND: FieldKind = FieldKind::Integer

Source§

fn to_value(&self) -> Value

Source§

impl<L: VecItem> FieldType for Vec<L>

Source§

const KIND: FieldKind = L::VEC_KIND

Source§

fn to_value(&self) -> Value

Source§

impl<T: FieldType> FieldType for Option<T>

Source§

const KIND: FieldKind = T::KIND

Source§

const OPTIONAL: bool = true

Source§

fn to_value(&self) -> Value

Implementors§

Source§

impl FieldType for Date

Source§

const KIND: FieldKind = FieldKind::Date

Source§

impl FieldType for DateTime

Source§

const KIND: FieldKind = FieldKind::DateTime

Source§

impl FieldType for Decimal

Source§

const KIND: FieldKind = FieldKind::Decimal

Source§

impl FieldType for File

One uploaded file.

Source§

impl FieldType for LocalDateTime

Source§

const KIND: FieldKind = FieldKind::LocalDateTime

Source§

impl FieldType for Money

Source§

const KIND: FieldKind = FieldKind::Money

Source§

impl FieldType for Slug

Source§

const KIND: FieldKind = FieldKind::Text

Source§

impl FieldType for Time

Source§

const KIND: FieldKind = FieldKind::Time