Writing Diesel CRUD operations for generic types
问题 I am trying to write a Rust crate which removes some boilerplate code from the user when creating simple CRUD operations with Diesel For instance, if you have a Diesel Insertable like this one: #[derive(Insertable)] #[table_name = "users"] pub struct UserCreate<'a> { pub email: String, pub hash: &'a [u8], pub first_name: Option<String>, pub family_name: Option<String>, } I want the crate user to just write create<UserCreate>(model, pool) , to insert the struct fields into a database row. To