DataMapper

Trait DataMapper 

Source
pub trait DataMapper {
    type Model;
    type Params;
    type Error;

    // Required methods
    fn insert(model: &Self::Model) -> Result<(), Self::Error>;
    fn update(model: &Self::Model) -> Result<(), Self::Error>;
    fn delete(model: &Self::Model) -> Result<(), Self::Error>;
}
Expand description

A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Required Associated Types§

Required Methods§

Source

fn insert(model: &Self::Model) -> Result<(), Self::Error>

Source

fn update(model: &Self::Model) -> Result<(), Self::Error>

Source

fn delete(model: &Self::Model) -> Result<(), Self::Error>

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§