pub struct Post {Show 17 fields
pub id: usize,
pub created: usize,
pub content: String,
pub owner: usize,
pub community: usize,
pub context: PostContext,
pub replying_to: Option<usize>,
pub likes: isize,
pub dislikes: isize,
pub comment_count: usize,
pub uploads: Vec<usize>,
pub is_deleted: bool,
pub poll_id: usize,
pub title: String,
pub is_open: bool,
pub stack: usize,
pub topic: usize,
}Fields§
§id: usize§created: usize§content: String§owner: usizeThe ID of the owner of this post.
community: usizeThe ID of the Community this post belongs to.
context: PostContextExtra information about the post.
replying_to: Option<usize>The ID of the post this post is a comment on.
likes: isize§dislikes: isize§comment_count: usize§uploads: Vec<usize>IDs of all uploads linked to this post.
is_deleted: boolIf the post was deleted.
poll_id: usizeThe ID of the poll associated with this post. 0 means no poll is connected.
title: StringThe title of the post (in communities where titles are enabled).
is_open: boolIf the post is “open”. Posts can act as tickets in a forge community.
stack: usizeThe ID of the stack this post belongs to. 0 means no stack is connected.
If stack is not 0, community should be 0 (and vice versa).
topic: usizeThe ID of the topic this post belongs to. 0 means no topic is connected.
This can only be set if the post is created in a community with is_forum: true,
where this is also a required field.
Implementations§
Source§impl Post
impl Post
Sourcepub fn new(
content: String,
community: usize,
replying_to: Option<usize>,
owner: usize,
poll_id: usize,
) -> Self
pub fn new( content: String, community: usize, replying_to: Option<usize>, owner: usize, poll_id: usize, ) -> Self
Create a new Post.
Sourcepub fn repost(
content: String,
community: usize,
owner: usize,
post_id: usize,
) -> Self
pub fn repost( content: String, community: usize, owner: usize, post_id: usize, ) -> Self
Create a new Post (as a repost of the given post_id).
Sourcepub fn mark_as_repost(&mut self)
pub fn mark_as_repost(&mut self)
Make the given post a reposted post.