Struct backend::db::content_reply::ActiveModel [−][src]
pub struct ActiveModel {
pub post_id: ActiveValue<i64>,
pub reply_id: ActiveValue<i32>,
pub burrow_id: ActiveValue<i64>,
pub create_time: ActiveValue<DateTimeWithTimeZone>,
pub update_time: ActiveValue<DateTimeWithTimeZone>,
pub content: ActiveValue<String>,
pub reply_state: ActiveValue<i32>,
pub permission: ActiveValue<i32>,
}
Fields
post_id: ActiveValue<i64>
reply_id: ActiveValue<i32>
burrow_id: ActiveValue<i64>
create_time: ActiveValue<DateTimeWithTimeZone>
update_time: ActiveValue<DateTimeWithTimeZone>
content: ActiveValue<String>
reply_state: ActiveValue<i32>
permission: ActiveValue<i32>
Trait Implementations
fn new() -> Self
fn new() -> Self
Create a new ActiveModel with default values. Also used by Default::default()
.
fn before_save(self, insert: bool) -> Result<Self, DbErr>
fn before_save(self, insert: bool) -> Result<Self, DbErr>
Will be called before saving
fn after_save(self, insert: bool) -> Result<Self, DbErr>
fn after_save(self, insert: bool) -> Result<Self, DbErr>
Will be called after saving
fn before_delete(self) -> Result<Self, DbErr>
fn before_delete(self) -> Result<Self, DbErr>
Will be called before deleting
fn after_delete(self) -> Result<Self, DbErr>
fn after_delete(self) -> Result<Self, DbErr>
Will be called after deleting
Get a mutable [ActiveValue] from an ActiveModel
Get a immutable [ActiveValue] from an ActiveModel
Set the Value into an ActiveModel
Set the state of an [ActiveValue] to the Unset state
Check the state of a [ActiveValue]
fn get_primary_key_value(&self) -> Option<ValueTuple>
fn get_primary_key_value(&self) -> Option<ValueTuple>
Get the primary key of the ActiveModel
fn insert<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn insert<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Perform an INSERT
operation on the ActiveModel Read more
fn update<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn update<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Perform the UPDATE
operation on an ActiveModel Read more
fn save<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn save<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait<'a> + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Insert the model if primary key is unset, update otherwise. Only works if the entity has auto increment primary key. Read more
Delete an active model by its primary key Read more
Method to call to perform the conversion
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ActiveModel
impl Send for ActiveModel
impl Sync for ActiveModel
impl Unpin for ActiveModel
impl UnwindSafe for ActiveModel
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global> where
T: Send,
pub fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global> where
T: Sync,
pub fn into_active_model(self) -> A
pub fn into_active_model(self) -> A
Method to call to perform the conversion
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more