Trait serde_db::ser::DbvFactory

source ·
pub trait DbvFactory: Sized {
    type DBV;

Show 16 methods fn from_bool(&self, value: bool) -> Result<Self::DBV, SerializationError>; fn from_i8(&self, value: i8) -> Result<Self::DBV, SerializationError>; fn from_i16(&self, value: i16) -> Result<Self::DBV, SerializationError>; fn from_i32(&self, value: i32) -> Result<Self::DBV, SerializationError>; fn from_i64(&self, value: i64) -> Result<Self::DBV, SerializationError>; fn from_u8(&self, value: u8) -> Result<Self::DBV, SerializationError>; fn from_u16(&self, value: u16) -> Result<Self::DBV, SerializationError>; fn from_u32(&self, value: u32) -> Result<Self::DBV, SerializationError>; fn from_u64(&self, value: u64) -> Result<Self::DBV, SerializationError>; fn from_f32(&self, value: f32) -> Result<Self::DBV, SerializationError>; fn from_f64(&self, value: f64) -> Result<Self::DBV, SerializationError>; fn from_char(&self, value: char) -> Result<Self::DBV, SerializationError>; fn from_str(&self, value: &str) -> Result<Self::DBV, SerializationError>; fn from_bytes(&self, value: &[u8]) -> Result<Self::DBV, SerializationError>; fn from_none(&self) -> Result<Self::DBV, SerializationError>; fn descriptor(&self) -> &'static str;
}
Expand description

A factory for database objects.

This trait is ot be implemented by descriptors of parameters for database commands.

Example

A parameter descriptor for a String-valued database type might implement all methods with adequate conversions, while a parameter descriptor for an integer type might only support conversions from the rust integer types.

Required Associated Types§

The type of the database objects.

Required Methods§

Serialize a bool.

Serialize an i8.

Serialize an i16.

Serialize an i32.

Serialize an i64.

Serialize an u8.

Serialize an u16.

Serialize an u32.

Serialize an u64.

Serialize an f32.

Serialize an f64.

Serialize a char.

Serialize a str.

Serialize bytes.

Serialize a none.

Provide a descriptive String of the type that is required (for error messages).

Implementors§