mae 0.3.14

Opinionated async Rust framework for building Mae-Technologies micro-services — app scaffolding, repo layer, middleware, and test utilities.
Documentation
use super::map_util::{BindArgs, ToSqlParts};
use crate::context::ContextAccessor;
use std::fmt::{Debug, Display};
// /////
// TYPES
//  ////

//  SOMETHING THAT WILL HAVE OUR CONTEXT -> C
pub trait Context: ContextAccessor + Unpin + Send + Sync {}
impl<C> Context for C where C: ContextAccessor + Unpin + Send + Sync {}

// SOMETHING THAT WILL CONVERT TO AN Insertable ROW -> T
pub trait ToInsertRow: ToSqlParts + BindArgs + Debug {}
impl<I> ToInsertRow for I where I: ToSqlParts + BindArgs + Debug {}

// SOMETHING THAT WILL CONVERT TO AN Updatable ROW -> T
pub trait ToUpdateRow: ToSqlParts + BindArgs + Debug {}
impl<U> ToUpdateRow for U where U: ToSqlParts + BindArgs + Debug {}

// SOMETHING THAT WILL CONVERT TO  A FIELD<T> -> P
pub trait ToPatch: ToSqlParts + BindArgs + Debug {}
impl<P> ToPatch for P where P: ToSqlParts + BindArgs + Debug {}

// SOMETHING THAT WILL CONVERT TO A FIELD -> F
pub trait ToField: ToSqlParts + Display {}
impl<F> ToField for F where F: ToSqlParts + Display {}

// SOMETHING THAT AN SQL ROW CAN BE CONVERTED INTO -> A
pub trait QueryAs: for<'r> sqlx::FromRow<'r, sqlx::postgres::PgRow> + Unpin + Send {}
impl<A> QueryAs for A where A: for<'r> sqlx::FromRow<'r, sqlx::postgres::PgRow> + Unpin + Send {}