pub trait Dummy<'t, 'a, S>: Sized {
type Out;
// Provided method
fn map_dummy<T>(
self,
f: impl FnMut(Self::Out) -> T + 't,
) -> impl Dummy<'t, 'a, S, Out = T> { ... }
}
Expand description
This trait is implemented by everything that can be retrieved from the database.
Implement it on custom structs using crate::FromDummy.
Required Associated Types§
Provided Methods§
Sourcefn map_dummy<T>(
self,
f: impl FnMut(Self::Out) -> T + 't,
) -> impl Dummy<'t, 'a, S, Out = T>
fn map_dummy<T>( self, f: impl FnMut(Self::Out) -> T + 't, ) -> impl Dummy<'t, 'a, S, Out = T>
Map a dummy to another dummy using native rust.
This is useful when retrieving a struct from the database that contains types not supported by the database. It is also useful in migrations to process rows using arbitrary rust.
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.