pub struct CommentClient<'a> { /* private fields */ }Expand description
评论 API 客户端。
Implementations§
Source§impl<'a> CommentClient<'a>
impl<'a> CommentClient<'a>
Sourcepub async fn add(&self, params: CommentAddParams) -> BpiResult<CommentData>
pub async fn add(&self, params: CommentAddParams) -> BpiResult<CommentData>
发布评论并返回标准 payload 结果。
Sourcepub async fn like(
&self,
params: CommentActionParams,
) -> BpiResult<Option<Value>>
pub async fn like( &self, params: CommentActionParams, ) -> BpiResult<Option<Value>>
点赞或取消点赞评论,并返回标准 payload 结果。
Sourcepub async fn dislike(
&self,
params: CommentActionParams,
) -> BpiResult<Option<Value>>
pub async fn dislike( &self, params: CommentActionParams, ) -> BpiResult<Option<Value>>
点踩或取消点踩评论,并返回标准 payload 结果。
Sourcepub async fn delete(
&self,
params: CommentDeleteParams,
) -> BpiResult<Option<Value>>
pub async fn delete( &self, params: CommentDeleteParams, ) -> BpiResult<Option<Value>>
删除评论并返回标准 payload 结果。
Source§impl<'a> CommentClient<'a>
impl<'a> CommentClient<'a>
Sourcepub async fn list(
&self,
params: CommentListParams,
) -> BpiResult<CommentListData>
pub async fn list( &self, params: CommentListParams, ) -> BpiResult<CommentListData>
获取目标评论区的主评论列表。
Sourcepub async fn replies(
&self,
params: CommentRepliesParams,
) -> BpiResult<CommentListData>
pub async fn replies( &self, params: CommentRepliesParams, ) -> BpiResult<CommentListData>
获取根评论下的回复。
Sourcepub async fn hot(
&self,
params: CommentHotParams,
) -> BpiResult<Option<HotCommentData>>
pub async fn hot( &self, params: CommentHotParams, ) -> BpiResult<Option<HotCommentData>>
当 API 返回 payload 时,获取根评论下的热评。
Sourcepub async fn count(&self, params: CommentCountParams) -> BpiResult<CountData>
pub async fn count(&self, params: CommentCountParams) -> BpiResult<CountData>
获取目标评论区的评论总数。
Trait Implementations§
Source§impl<'a> Clone for CommentClient<'a>
impl<'a> Clone for CommentClient<'a>
Source§fn clone(&self) -> CommentClient<'a>
fn clone(&self) -> CommentClient<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for CommentClient<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CommentClient<'a>
impl<'a> !UnwindSafe for CommentClient<'a>
impl<'a> Freeze for CommentClient<'a>
impl<'a> Send for CommentClient<'a>
impl<'a> Sync for CommentClient<'a>
impl<'a> Unpin for CommentClient<'a>
impl<'a> UnsafeUnpin for CommentClient<'a>
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