pub struct DiscussManager { /* private fields */ }Expand description
Discuss manager
Implementations§
Source§impl DiscussManager
impl DiscussManager
Sourcepub fn new(storage: StorageManager, identity: EnhancedIdentity) -> Self
pub fn new(storage: StorageManager, identity: EnhancedIdentity) -> Self
Create new discuss manager
Sourcepub async fn create_category(
&mut self,
name: String,
description: String,
parent_id: Option<CategoryId>,
access_level: AccessLevel,
organization_id: Option<OrganizationId>,
) -> Result<Category, DiscussError>
pub async fn create_category( &mut self, name: String, description: String, parent_id: Option<CategoryId>, access_level: AccessLevel, organization_id: Option<OrganizationId>, ) -> Result<Category, DiscussError>
Create a new category
Sourcepub async fn create_topic(
&mut self,
category_id: CategoryId,
title: String,
content: String,
topic_type: TopicType,
tags: Vec<Tag>,
) -> Result<Topic, DiscussError>
pub async fn create_topic( &mut self, category_id: CategoryId, title: String, content: String, topic_type: TopicType, tags: Vec<Tag>, ) -> Result<Topic, DiscussError>
Create a new topic
Sourcepub async fn post_reply(
&mut self,
topic_id: TopicId,
content: String,
reply_to: Option<ReplyId>,
) -> Result<Reply, DiscussError>
pub async fn post_reply( &mut self, topic_id: TopicId, content: String, reply_to: Option<ReplyId>, ) -> Result<Reply, DiscussError>
Post a reply
Sourcepub async fn vote(
&mut self,
target: VoteTarget,
vote_type: VoteType,
) -> Result<(), DiscussError>
pub async fn vote( &mut self, target: VoteTarget, vote_type: VoteType, ) -> Result<(), DiscussError>
Vote on content
Sourcepub async fn edit_topic(
&mut self,
topic_id: &TopicId,
new_content: String,
edit_reason: Option<String>,
) -> Result<(), DiscussError>
pub async fn edit_topic( &mut self, topic_id: &TopicId, new_content: String, edit_reason: Option<String>, ) -> Result<(), DiscussError>
Edit topic (wiki mode)
Auto Trait Implementations§
impl !Freeze for DiscussManager
impl !RefUnwindSafe for DiscussManager
impl Send for DiscussManager
impl Sync for DiscussManager
impl Unpin for DiscussManager
impl !UnwindSafe for DiscussManager
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