pub struct ActiveModel {
pub user_id: ActiveValue<UserId>,
pub role_id: ActiveValue<RoleId>,
}Available on crate feature
rbac only.Expand description
Generated by sea-orm-macros
Fieldsยง
ยงuser_id: ActiveValue<UserId>Generated by sea-orm-macros
role_id: ActiveValue<RoleId>Generated by sea-orm-macros
Trait Implementationsยง
Sourceยงimpl ActiveModelBehavior for ActiveModel
impl ActiveModelBehavior for ActiveModel
Sourceยงfn new() -> Self
fn new() -> Self
Create a new ActiveModel with default values. This is also called by
Default::default(). Read moreSourceยงfn before_save<C>(self, db: &C, insert: bool) -> Result<Self, DbErr>where
C: ConnectionTrait,
fn before_save<C>(self, db: &C, insert: bool) -> Result<Self, DbErr>where
C: ConnectionTrait,
Will be called before
ActiveModel::insert, ActiveModel::update, and ActiveModel::saveSourceยงfn after_save<C>(
model: <Self::Entity as EntityTrait>::Model,
db: &C,
insert: bool,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
C: ConnectionTrait,
fn after_save<C>(
model: <Self::Entity as EntityTrait>::Model,
db: &C,
insert: bool,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
C: ConnectionTrait,
Will be called after
ActiveModel::insert, ActiveModel::update, and ActiveModel::saveSourceยงfn before_delete<C>(self, db: &C) -> Result<Self, DbErr>where
C: ConnectionTrait,
fn before_delete<C>(self, db: &C) -> Result<Self, DbErr>where
C: ConnectionTrait,
Will be called before
ActiveModel::deleteSourceยงfn after_delete<C>(self, db: &C) -> Result<Self, DbErr>where
C: ConnectionTrait,
fn after_delete<C>(self, db: &C) -> Result<Self, DbErr>where
C: ConnectionTrait,
Will be called after
ActiveModel::deleteSourceยงimpl ActiveModelTrait for ActiveModel
impl ActiveModelTrait for ActiveModel
Sourceยงfn take(
&mut self,
c: <Self::Entity as EntityTrait>::Column,
) -> ActiveValue<Value>
fn take( &mut self, c: <Self::Entity as EntityTrait>::Column, ) -> ActiveValue<Value>
Get a mutable ActiveValue from an ActiveModel
Sourceยงfn get(&self, c: <Self::Entity as EntityTrait>::Column) -> ActiveValue<Value>
fn get(&self, c: <Self::Entity as EntityTrait>::Column) -> ActiveValue<Value>
Get a immutable ActiveValue from an ActiveModel
Sourceยงfn set_if_not_equals(
&mut self,
c: <Self::Entity as EntityTrait>::Column,
v: Value,
)
fn set_if_not_equals( &mut self, c: <Self::Entity as EntityTrait>::Column, v: Value, )
Set the Value of a ActiveModel field if value is different, panic if failed
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 ActiveModel field, return error if failed
Sourceยงfn not_set(&mut self, c: <Self::Entity as EntityTrait>::Column)
fn not_set(&mut self, c: <Self::Entity as EntityTrait>::Column)
Set the state of an ActiveValue to the not set state
Sourceยงfn is_not_set(&self, c: <Self::Entity as EntityTrait>::Column) -> bool
fn is_not_set(&self, c: <Self::Entity as EntityTrait>::Column) -> bool
Check the state of a ActiveValue
Sourceยงfn reset(&mut self, c: <Self::Entity as EntityTrait>::Column)
fn reset(&mut self, c: <Self::Entity as EntityTrait>::Column)
Reset the value from ActiveValue::Unchanged to ActiveValue::Set,
leaving ActiveValue::NotSet untouched.
Sourceยงfn default_values() -> Self
fn default_values() -> Self
Create an ActiveModel with all fields to Set(default_value) if Default is implemented, NotSet otherwise
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 ActiveModel field, panic if failed
Sourceยงfn reset_all(self) -> Self
fn reset_all(self) -> Self
Reset all values from ActiveValue::Unchanged to ActiveValue::Set,
leaving ActiveValue::NotSet untouched.
Sourceยงfn get_primary_key_value(&self) -> Option<ValueTuple>
fn get_primary_key_value(&self) -> Option<ValueTuple>
Get the primary key of the ActiveModel, only if itโs fully specified.
Sourceยงfn insert<'a, C>(
self,
db: &'a C,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
fn insert<'a, C>(
self,
db: &'a C,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
Perform an
INSERT operation on the ActiveModel Read moreSourceยงfn update<'a, C>(
self,
db: &'a C,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
fn update<'a, C>(
self,
db: &'a C,
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
Perform the
UPDATE operation on an ActiveModel Read moreSourceยงfn save<'a, C>(self, db: &'a C) -> Result<Self, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
fn save<'a, C>(self, db: &'a C) -> Result<Self, DbErr>where
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Self: ActiveModelBehavior,
C: ConnectionTrait,
Insert the model if primary key is
NotSet, update otherwise.
Only works if the entity has auto increment primary key.Sourceยงfn delete<'a, C>(self, db: &'a C) -> Result<DeleteResult, DbErr>where
Self: ActiveModelBehavior,
C: ConnectionTrait,
fn delete<'a, C>(self, db: &'a C) -> Result<DeleteResult, DbErr>where
Self: ActiveModelBehavior,
C: ConnectionTrait,
Delete an active model by its primary key Read more
Sourceยงfn is_changed(&self) -> bool
fn is_changed(&self) -> bool
Return
true if any attribute of ActiveModel is SetFind related Models belonging to self
Sourceยงimpl Clone for ActiveModel
impl Clone for ActiveModel
Sourceยงfn clone(&self) -> ActiveModel
fn clone(&self) -> ActiveModel
Returns a duplicate 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 moreSourceยงimpl Debug for ActiveModel
impl Debug for ActiveModel
Sourceยงimpl Default for ActiveModel
impl Default for ActiveModel
Sourceยงimpl From<Model> for ActiveModel
impl From<Model> for ActiveModel
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 PartialEq for ActiveModel
impl PartialEq for ActiveModel
Sourceยงimpl TryFrom<ActiveModel> for Model
impl TryFrom<ActiveModel> for Model
Sourceยงimpl TryIntoModel<Model> for ActiveModel
impl TryIntoModel<Model> for ActiveModel
impl StructuralPartialEq for ActiveModel
Auto Trait Implementationsยง
impl Freeze for ActiveModel
impl RefUnwindSafe for ActiveModel
impl Send for ActiveModel
impl Sync for ActiveModel
impl Unpin for ActiveModel
impl UnwindSafe for ActiveModel
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<A> IntoActiveModel<A> for Awhere
A: ActiveModelTrait,
impl<A> IntoActiveModel<A> for Awhere
A: ActiveModelTrait,
Sourceยงfn into_active_model(self) -> A
fn into_active_model(self) -> A
Method to call to perform the conversion
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 more