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
sourceimpl 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
sourceimpl Clone for InsertableGenre
impl Clone for InsertableGenre
sourcefn clone(&self) -> InsertableGenre
fn clone(&self) -> InsertableGenre
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl RefUnwindSafe for InsertableGenre
impl Send for InsertableGenre
impl Sync for InsertableGenre
impl Unpin for InsertableGenre
impl UnwindSafe for InsertableGenre
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more