pub struct Model {
pub id: LibraryId,
pub directory: PathBytes,
pub last_scan: Option<DateTime<Utc>>,
}Expand description
The database representation of a library media folder
Fields§
§id: LibraryIdThe library’s ID
directory: PathBytesThe library’s directory
last_scan: Option<DateTime<Utc>>The library’s last scan data
Implementations§
Source§impl Model
impl Model
Sourcepub async fn cascade_delete<'a, C>(
self,
db: &'a C,
) -> Result<DeleteResult, DbErr>where
C: TransactionTrait,
pub async fn cascade_delete<'a, C>(
self,
db: &'a C,
) -> Result<DeleteResult, DbErr>where
C: TransactionTrait,
Generated by sea-orm-macros
Trait Implementations§
Source§impl From<Model> for ActiveModel
impl From<Model> for ActiveModel
Source§impl FromQueryResult for Model
impl FromQueryResult for Model
Source§fn from_query_result(row: &QueryResult, pre: &str) -> Result<Self, DbErr>
fn from_query_result(row: &QueryResult, pre: &str) -> Result<Self, DbErr>
Instantiate a Model from a QueryResult Read more
Source§fn from_query_result_optional(
res: &QueryResult,
pre: &str,
) -> Result<Option<Self>, DbErr>
fn from_query_result_optional( res: &QueryResult, pre: &str, ) -> Result<Option<Self>, DbErr>
Transform the error from instantiating a Model from a QueryResult
and converting it to an Option
Source§fn from_query_result_nullable(
res: &QueryResult,
pre: &str,
) -> Result<Self, TryGetError>
fn from_query_result_nullable( res: &QueryResult, pre: &str, ) -> Result<Self, TryGetError>
Transform the error from instantiating a Model from a QueryResult
and converting it to an Option Read more
Source§fn find_by_statement(stmt: Statement) -> SelectorRaw<SelectModel<Self>>
fn find_by_statement(stmt: Statement) -> SelectorRaw<SelectModel<Self>>
Source§impl IntoActiveModel<ActiveModel> for Model
impl IntoActiveModel<ActiveModel> for Model
Source§fn into_active_model(self) -> ActiveModel
fn into_active_model(self) -> ActiveModel
Method to call to perform the conversion
Source§impl ModelTrait for Model
impl ModelTrait for Model
type Entity = Entity
Source§fn get(&self, c: <Self::Entity as EntityTrait>::Column) -> Value
fn get(&self, c: <Self::Entity as EntityTrait>::Column) -> Value
Get the Value of a column from a Model
Source§fn get_value_type(c: <Self::Entity as EntityTrait>::Column) -> ArrayType
fn get_value_type(c: <Self::Entity as EntityTrait>::Column) -> ArrayType
Get the Value Type of a column from the Model
Source§fn try_set(
&mut self,
c: <Self::Entity as EntityTrait>::Column,
v: Value,
) -> Result<(), DbErr>
fn try_set( &mut self, c: <Self::Entity as EntityTrait>::Column, v: Value, ) -> Result<(), DbErr>
Set the Value of a Model field, return error if failed
Source§fn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value)
fn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value)
Set the Value of a Model field, panic if failed
Find related Models belonging to self
Source§fn find_linked<L>(&self, l: L) -> Select<<L as Linked>::ToEntity>
fn find_linked<L>(&self, l: L) -> Select<<L as Linked>::ToEntity>
Find linked Models belonging to self
Source§fn delete<'a, 'async_trait, A, C>(
self,
db: &'a C,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, DbErr>> + Send + 'async_trait>>where
'a: 'async_trait,
Self: IntoActiveModel<A> + 'async_trait,
C: ConnectionTrait + 'async_trait,
A: ActiveModelTrait<Entity = Self::Entity> + ActiveModelBehavior + Send + 'a + 'async_trait,
fn delete<'a, 'async_trait, A, C>(
self,
db: &'a C,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, DbErr>> + Send + 'async_trait>>where
'a: 'async_trait,
Self: IntoActiveModel<A> + 'async_trait,
C: ConnectionTrait + 'async_trait,
A: ActiveModelTrait<Entity = Self::Entity> + ActiveModelBehavior + Send + 'a + 'async_trait,
Delete a model
Source§fn get_primary_key_value(&self) -> ValueTuple
fn get_primary_key_value(&self) -> ValueTuple
Get the primary key value of the Model
Source§impl TryFrom<ActiveModel> for Model
impl TryFrom<ActiveModel> for Model
Source§impl TryIntoModel<Model> for ActiveModel
impl TryIntoModel<Model> for ActiveModel
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PartialModelTrait for Twhere
T: ModelTrait + FromQueryResult,
impl<T> PartialModelTrait for Twhere
T: ModelTrait + FromQueryResult,
Source§fn select_cols_nested<S>(
select: S,
prefix: Option<&str>,
alias: Option<&'static str>,
) -> Swhere
S: QuerySelect,
fn select_cols_nested<S>(
select: S,
prefix: Option<&str>,
alias: Option<&'static str>,
) -> Swhere
S: QuerySelect,
Used when nesting these structs into each other. Read more
Source§fn select_cols<S>(select: S) -> Swhere
S: QuerySelect,
fn select_cols<S>(select: S) -> Swhere
S: QuerySelect,
Select specific columns this [PartialModel] needs Read more
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<M> TryIntoModel<M> for Mwhere
M: ModelTrait,
impl<M> TryIntoModel<M> for Mwhere
M: ModelTrait,
Source§fn try_into_model(self) -> Result<M, DbErr>
fn try_into_model(self) -> Result<M, DbErr>
Method to call to perform the conversion