pub struct Model {
pub id: PermissionId,
pub action: String,
}Available on crate feature
rbac only.Fieldsยง
ยงid: PermissionIdยงaction: StringImplementationsยง
Trait Implementationsยง
Sourceยงimpl From<Model> for ActiveModel
impl From<Model> for ActiveModel
Sourceยงimpl From<Model> for PermissionRequest
impl From<Model> for PermissionRequest
Sourceยงfn from(permission: Permission) -> Self
fn from(permission: Permission) -> Self
Converts to this type from the input type.
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::ToEntity>
fn find_linked<L>(&self, l: L) -> Select<L::ToEntity>
Find linked Models belonging to self
Sourceยงfn delete<'a, A, C>(self, db: &'a C) -> Result<DeleteResult, DbErr>where
Self: IntoActiveModel<A>,
C: ConnectionTrait,
A: ActiveModelTrait<Entity = Self::Entity> + ActiveModelBehavior + 'a,
fn delete<'a, A, C>(self, db: &'a C) -> Result<DeleteResult, DbErr>where
Self: IntoActiveModel<A>,
C: ConnectionTrait,
A: ActiveModelTrait<Entity = Self::Entity> + ActiveModelBehavior + 'a,
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
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<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<M> IntoMockRow for Mwhere
M: ModelTrait,
impl<M> IntoMockRow for Mwhere
M: ModelTrait,
Sourceยงfn into_mock_row(self) -> MockRow
fn into_mock_row(self) -> MockRow
Available on crate feature
mock only.The method to perform this operation
Sourceยง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: QuerySelect>(select: S) -> S
fn select_cols<S: QuerySelect>(select: S) -> S
Select specific columns this [PartialModel] needs Read more
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