pub trait AsyncCommentsService {
// 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§
Sourcefn get_conversation(
&self,
auth_: BearerToken,
resource_type: ResourceType,
resource_rid: ResourceIdentifier,
) -> impl Future<Output = Result<Conversation, Error>> + Send
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.
Sourcefn 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_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.
Sourcefn get_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> impl Future<Output = Result<Comment, Error>> + Send
fn get_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send
Get a comment identified by its RID
Sourcefn create_comment(
&self,
auth_: BearerToken,
request: CreateCommentRequest,
) -> impl Future<Output = Result<Comment, Error>> + Send
fn create_comment( &self, auth_: BearerToken, request: CreateCommentRequest, ) -> impl Future<Output = Result<Comment, Error>> + Send
Create a comment on a resource
Sourcefn edit_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
request: EditCommentRequest,
) -> 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
Edit an existing comment
Sourcefn delete_comment(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
) -> impl Future<Output = Result<Comment, Error>> + Send
fn delete_comment( &self, auth_: BearerToken, comment_rid: CommentRid, ) -> impl Future<Output = Result<Comment, Error>> + Send
Delete an existing comment
Sourcefn pin_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
Pin a comment to the top of the conversation
Sourcefn unpin_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
Unpin a comment from the top of the conversation
Sourcefn add_reaction(
&self,
auth_: BearerToken,
comment_rid: CommentRid,
type_: ReactionType,
) -> 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
Create a reaction on a comment
Sourcefn remove_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
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", so this trait is not object safe.