Struct lemmy_db_schema::source::comment::Comment [−][src]
pub struct Comment {
pub id: CommentId,
pub creator_id: PersonId,
pub post_id: PostId,
pub parent_id: Option<CommentId>,
pub content: String,
pub removed: bool,
pub read: bool,
pub published: NaiveDateTime,
pub updated: Option<NaiveDateTime>,
pub deleted: bool,
pub ap_id: DbUrl,
pub local: bool,
}
Fields
id: CommentId
creator_id: PersonId
post_id: PostId
parent_id: Option<CommentId>
content: String
removed: bool
read: bool
published: NaiveDateTime
updated: Option<NaiveDateTime>
deleted: bool
ap_id: DbUrl
local: bool
Implementations
pub fn update_ap_id(
conn: &PgConnection,
comment_id: CommentId,
apub_id: DbUrl
) -> Result<Self, Error>
pub fn permadelete_for_creator(
conn: &PgConnection,
for_creator_id: PersonId
) -> Result<Vec<Self>, Error>
pub fn update_deleted(
conn: &PgConnection,
comment_id: CommentId,
new_deleted: bool
) -> Result<Self, Error>
pub fn update_removed(
conn: &PgConnection,
comment_id: CommentId,
new_removed: bool
) -> Result<Self, Error>
pub fn update_removed_for_creator(
conn: &PgConnection,
for_creator_id: PersonId,
new_removed: bool
) -> Result<Vec<Self>, Error>
pub fn update_read(
conn: &PgConnection,
comment_id: CommentId,
new_read: bool
) -> Result<Self, Error>
pub fn update_content(
conn: &PgConnection,
comment_id: CommentId,
new_content: &str
) -> Result<Self, Error>
Trait Implementations
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = comment_id
type ForeignKeyColumn = comment_id
The database column representing the foreign key of the table this struct represents Read more
Returns the foreign key for self
Returns the foreign key column of this struct’s table
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = comment_id
type ForeignKeyColumn = comment_id
The database column representing the foreign key of the table this struct represents Read more
Returns the foreign key for self
Returns the foreign key column of this struct’s table
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = comment_id
type ForeignKeyColumn = comment_id
The database column representing the foreign key of the table this struct represents Read more
Returns the foreign key for self
Returns the foreign key column of this struct’s table
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = comment_id
type ForeignKeyColumn = comment_id
The database column representing the foreign key of the table this struct represents Read more
Returns the foreign key for self
Returns the foreign key column of this struct’s table
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = post_id
type ForeignKeyColumn = post_id
The database column representing the foreign key of the table this struct represents Read more
Returns the foreign key for self
Returns the foreign key column of this struct’s table
type Form = CommentForm
fn update(
conn: &PgConnection,
comment_id: CommentId,
comment_form: &CommentForm
) -> Result<Self, Error>
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
Auto Trait Implementations
impl RefUnwindSafe for Comment
impl UnwindSafe for Comment
Blanket Implementations
impl<'a, Parent, Child> BelongingToDsl<&'a [Parent]> for Child where
Child: HasTable + BelongsTo<Parent>,
&'a Parent: Identifiable,
Vec<<&'a Parent as Identifiable>::Id, Global>: AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>,
<Child as HasTable>::Table: FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>,
<Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods,
impl<'a, Parent, Child> BelongingToDsl<&'a [Parent]> for Child where
Child: HasTable + BelongsTo<Parent>,
&'a Parent: Identifiable,
Vec<<&'a Parent as Identifiable>::Id, Global>: AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>,
<Child as HasTable>::Table: FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>,
<Child as BelongsTo<Parent>>::ForeignKeyColumn: ExpressionMethods,
type Output = <<Child as HasTable>::Table as FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>>::Output
type Output = <<Child as HasTable>::Table as FilterDsl<In<<Child as BelongsTo<Parent>>::ForeignKeyColumn, <Vec<<&'a Parent as Identifiable>::Id, Global> as AsInExpression<<<Child as BelongsTo<Parent>>::ForeignKeyColumn as Expression>::SqlType>>::InExpression>>>::Output
The query returned by belonging_to
Get the record(s) belonging to record(s) other
impl<'a, Parent, Child> BelongingToDsl<&'a Vec<Parent, Global>> for Child where
Child: BelongingToDsl<&'a [Parent]>,
impl<'a, Parent, Child> BelongingToDsl<&'a Vec<Parent, Global>> for Child where
Child: BelongingToDsl<&'a [Parent]>,
type Output = <Child as BelongingToDsl<&'a [Parent]>>::Output
type Output = <Child as BelongingToDsl<&'a [Parent]>>::Output
The query returned by belonging_to
pub fn belonging_to(
parents: &'a Vec<Parent, Global>
) -> <Child as BelongingToDsl<&'a Vec<Parent, Global>>>::Output
pub fn belonging_to(
parents: &'a Vec<Parent, Global>
) -> <Child as BelongingToDsl<&'a Vec<Parent, Global>>>::Output
Get the record(s) belonging to record(s) other
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Convert self
to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel’s query builder. Read more
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
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