Skip to main content

FactoryValue

Trait FactoryValue 

Source
pub trait FactoryValue: Sized {
    // Required method
    fn factory_value(field: &str, seq: u64) -> Self;

    // Provided method
    fn factory_key(field: &str, seq: u64) -> Self { ... }
}
Available on crate features model-mysql or model-postgres or model-sqlite only.
Expand description

A type with a factory default; see the module docs for the values.

Required Methods§

Source

fn factory_value(field: &str, seq: u64) -> Self

The value of field field in instance seq.

Provided Methods§

Source

fn factory_key(field: &str, seq: u64) -> Self

The value as a primary key that isn’t auto-incremented: unique per instance where the type allows it.

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 FactoryValue for String

Source§

fn factory_value(field: &str, seq: u64) -> String

Source§

impl FactoryValue for Vec<u8>

Source§

fn factory_value(_field: &str, _seq: u64) -> Vec<u8> ⓘ

Source§

impl FactoryValue for bool

Source§

fn factory_value(_field: &str, _seq: u64) -> bool

Source§

impl FactoryValue for f32

Source§

fn factory_value(_field: &str, _seq: u64) -> f32

Source§

fn factory_key(_field: &str, seq: u64) -> f32

Source§

impl FactoryValue for f64

Source§

fn factory_value(_field: &str, _seq: u64) -> f64

Source§

fn factory_key(_field: &str, seq: u64) -> f64

Source§

impl FactoryValue for i8

Source§

fn factory_value(_field: &str, _seq: u64) -> i8

Source§

fn factory_key(_field: &str, seq: u64) -> i8

Source§

impl FactoryValue for i16

Source§

fn factory_value(_field: &str, _seq: u64) -> i16

Source§

fn factory_key(_field: &str, seq: u64) -> i16

Source§

impl FactoryValue for i32

Source§

fn factory_value(_field: &str, _seq: u64) -> i32

Source§

fn factory_key(_field: &str, seq: u64) -> i32

Source§

impl FactoryValue for i64

Source§

fn factory_value(_field: &str, _seq: u64) -> i64

Source§

fn factory_key(_field: &str, seq: u64) -> i64

Source§

impl FactoryValue for u8

Source§

fn factory_value(_field: &str, _seq: u64) -> u8

Source§

fn factory_key(_field: &str, seq: u64) -> u8

Source§

impl FactoryValue for u16

Source§

fn factory_value(_field: &str, _seq: u64) -> u16

Source§

fn factory_key(_field: &str, seq: u64) -> u16

Source§

impl FactoryValue for u32

Source§

fn factory_value(_field: &str, _seq: u64) -> u32

Source§

fn factory_key(_field: &str, seq: u64) -> u32

Source§

impl FactoryValue for u64

Source§

fn factory_value(_field: &str, _seq: u64) -> u64

Source§

fn factory_key(_field: &str, seq: u64) -> u64

Source§

impl<T> FactoryValue for Option<T>

Source§

fn factory_value(_field: &str, _seq: u64) -> Option<T>

Implementors§