I am writing a storage module for my app which has support for generic backends.
At the moment I am just implementing postgres backend.
I created a trait named ToDbVal
which will be useful when I need to translate rust values to whatever driver counterpart value is.
So I want to implement ToDbVal for everything that is already postgres::types::ToSql
something like the following
impl ToDbVal for T:ToSql{
fn to_db_val(&self)->Self::Output{
...
}
}
Is this possible?