Skip to main content

AsyncCommentsService

Trait AsyncCommentsService 

Source
pub trait AsyncCommentsService<I>
where I: Stream<Item = Result<Bytes, Error>>,
{ // Required methods fn get_conversation( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, ) -> impl Future<Output = Result<Conversation, Error>> + Send; fn get_conversation_count( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, include_deleted: Option<bool>, ) -> impl Future<Output = Result<i32, Error>> + Send; fn get_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn create_comment( &self, auth_: &BearerToken, request: &CreateCommentRequest, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn edit_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, request: &EditCommentRequest, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn delete_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn pin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn unpin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn add_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> impl Future<Output = Result<Comment, Error>> + Send; fn remove_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> impl Future<Output = Result<Comment, Error>> + Send; }
Expand description

Comments service manages conversations about resources.

Required Methods§

Source

fn get_conversation( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, ) -> impl Future<Output = Result<Conversation, Error>> + Send

A conversation is a fully resolved comment tree. It includes all comments for the given resource and all the nested comments/replies to those comments.

Source

fn get_conversation_count( &self, auth_: &BearerToken, resource_type: &ResourceType, resource_rid: &ResourceIdentifier, include_deleted: Option<bool>, ) -> impl Future<Output = Result<i32, Error>> + Send

Returns the number of comments in a conversation.

Source

fn get_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send

Get a comment identified by its RID

Source

fn create_comment( &self, auth_: &BearerToken, request: &CreateCommentRequest, ) -> impl Future<Output = Result<Comment, Error>> + Send

Create a comment on a resource

Source

fn edit_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, request: &EditCommentRequest, ) -> impl Future<Output = Result<Comment, Error>> + Send

Edit an existing comment

Source

fn delete_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send

Delete an existing comment

Source

fn pin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send

Pin a comment to the top of the conversation

Source

fn unpin_comment( &self, auth_: &BearerToken, comment_rid: &CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send

Unpin a comment from the top of the conversation

Source

fn add_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> impl Future<Output = Result<Comment, Error>> + Send

Create a reaction on a comment

Source

fn remove_reaction( &self, auth_: &BearerToken, comment_rid: &CommentRid, type_: &ReactionType, ) -> impl Future<Output = Result<Comment, Error>> + Send

Create a reaction on a comment

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, __C> AsyncCommentsService<I> for AsyncCommentsServiceClient<__C>
where I: Stream<Item = Result<Bytes, Error>>, __C: AsyncClient<ResponseBody = I> + Sync + Send, <__C as AsyncClient>::ResponseBody: 'static + Send,