diesel::connection

Trait MultiConnectionHelper

Source
pub trait MultiConnectionHelper: Connection {
    // Required methods
    fn to_any<'a>(
        lookup: &mut <Self::Backend as TypeMetadata>::MetadataLookup,
    ) -> &mut (dyn Any + 'a);
    fn from_any(
        lookup: &mut dyn Any,
    ) -> Option<&mut <Self::Backend as TypeMetadata>::MetadataLookup>;
}
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
Expand description

This trait provides helper methods to convert a database lookup type to/from an std::any::Any reference. This is used internally by the #[derive(MultiConnection)] implementation

Required Methods§

Source

fn to_any<'a>( lookup: &mut <Self::Backend as TypeMetadata>::MetadataLookup, ) -> &mut (dyn Any + 'a)

Convert the lookup type to any

Source

fn from_any( lookup: &mut dyn Any, ) -> Option<&mut <Self::Backend as TypeMetadata>::MetadataLookup>

Get the lookup type from any

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.

Implementors§

Source§

impl MultiConnectionHelper for MysqlConnection

Available on crate features mysql and mysql_backend only.
Source§

impl MultiConnectionHelper for PgConnection

Available on crate features postgres and postgres_backend only.
Source§

impl MultiConnectionHelper for SqliteConnection

Available on crate feature sqlite only.