pub struct Model {
pub api_key_id: PrimaryId,
pub id: String,
pub uuid: Uuid,
pub is_active: bool,
pub updated_at: Option<DateTime>,
pub created_at: DateTime,
pub key: String,
}Fields§
§api_key_id: PrimaryId§id: String§uuid: Uuid§is_active: bool§updated_at: Option<DateTime>§created_at: DateTime§key: StringImplementations§
Trait Implementations§
Source§impl BasicModel for Model
impl BasicModel for Model
type ActiveModel = ActiveModel
fn create<'life0, 'async_trait>(
db: &'life0 Db,
data: Self::ActiveModel,
) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn create_many<'life0, 'async_trait>(
db: &'life0 Db,
data: Vec<Self::ActiveModel>,
) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
db: &'life0 Db,
primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType,
) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_by_id<'life0, 'life1, 'async_trait>(
db: &'life0 Db,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all<'life0, 'async_trait>(
db: &'life0 Db,
) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_all_where<'life0, 'async_trait>(
db: &'life0 Db,
conditions: Vec<SimpleExpr>,
offset: Option<u64>,
limit: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn update_by_id<'life0, 'life1, 'async_trait>(
db: &'life0 Db,
id: &'life1 str,
data: Self::ActiveModel,
) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'async_trait>(
db: &'life0 Db,
primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType,
) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn delete_by_id<'life0, 'life1, 'async_trait>(
db: &'life0 Db,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_by_ids<'life0, 'async_trait>(
db: &'life0 Db,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<u64, DbErr>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
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 find_by_statement(stmt: Statement) -> SelectorRaw<SelectModel<Self>>
fn find_by_statement(stmt: Statement) -> SelectorRaw<SelectModel<Self>>
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 an Entity
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 column in an Entity
Find related Models
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 an model
impl Eq for Model
impl StructuralPartialEq for Model
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> 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> Pointable for T
impl<T> Pointable for T
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