Struct database::genre::InsertableGenre
source · pub struct InsertableGenre {
pub name: String,
}
Expand description
Genre entry that can be inserted into the db.
Fields§
§name: String
Genre name
Implementations§
source§impl InsertableGenre
impl InsertableGenre
sourcepub async fn insert(
&self,
conn: &mut Transaction<'_>
) -> Result<i64, DatabaseError>
pub async fn insert(
&self,
conn: &mut Transaction<'_>
) -> Result<i64, DatabaseError>
Method inserts a new genre into the table otherwise returns the id of a existing entry
Arguments
conn
- mutable reference to a sqlx transaction.
Trait Implementations§
source§impl Clone for InsertableGenre
impl Clone for InsertableGenre
source§fn clone(&self) -> InsertableGenre
fn clone(&self) -> InsertableGenre
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more