Skip to main content

SqlTypeConvert

Trait SqlTypeConvert 

Source
pub trait SqlTypeConvert: Sized {
    type Raw: Sized;

    // Required methods
    fn to_raw_sql(self) -> Self::Raw;
    fn from_raw_sql(
        _raw: Self::Raw,
    ) -> Result<Self, DatabaseTypeConversionError>;

    // Provided method
    fn map_err<E: Error + Send + Sync + 'static>(
        source: E,
    ) -> DatabaseTypeConversionError { ... }
}
Expand description

Convert from and to it’s database representation and back

We do not assume sanity of DB types.

Required Associated Types§

Required Methods§

Provided Methods§

Source

fn map_err<E: Error + Send + Sync + 'static>( source: E, ) -> DatabaseTypeConversionError

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SqlTypeConvert for StorageSlotType

Source§

impl SqlTypeConvert for StorageSlotName

Source§

impl SqlTypeConvert for BlockNumber

Source§

impl SqlTypeConvert for NoteTag

Implementors§