pub struct TagsHandler<'a> { /* private fields */ }Expand description
Handler for tag-related API endpoints (followed and featured tags).
Implementations§
Source§impl<'a> TagsHandler<'a>
impl<'a> TagsHandler<'a>
Sourcepub fn new(client: &'a MastodonClient) -> Self
pub fn new(client: &'a MastodonClient) -> Self
Creates a new TagsHandler for the given client.
Sourcepub async fn list_followed(&self) -> Result<Vec<Tag>>
pub async fn list_followed(&self) -> Result<Vec<Tag>>
Fetches all tags that the authenticated user is following.
Returns:
Result<Vec<Tag>>: The followed tags.
Corresponds to GET /api/v1/followed_tags.
Sourcepub async fn follow(&self, name: &str) -> Result<Tag>
pub async fn follow(&self, name: &str) -> Result<Tag>
Follows a tag.
Parameters:
name: The name of the tag to follow.
Returns:
Result<Tag>: The followed tag.
Corresponds to POST /api/v1/tags/:name/follow.
Sourcepub async fn unfollow(&self, name: &str) -> Result<Tag>
pub async fn unfollow(&self, name: &str) -> Result<Tag>
Unfollows a tag.
Parameters:
name: The name of the tag to unfollow.
Returns:
Result<Tag>: The unfollowed tag.
Corresponds to POST /api/v1/tags/{name}/unfollow.
Sourcepub async fn list_featured(&self) -> Result<Vec<FeaturedTag>>
pub async fn list_featured(&self) -> Result<Vec<FeaturedTag>>
Fetches all tags featured on the authenticated user’s profile.
Returns:
Result<Vec<FeaturedTag>>: The featured tags.
Corresponds to GET /api/v1/featured_tags.
Sourcepub async fn feature(&self, name: &str) -> Result<FeaturedTag>
pub async fn feature(&self, name: &str) -> Result<FeaturedTag>
Features a tag on the authenticated user’s profile.
Parameters:
name: The name of the tag to feature.
Returns:
Result<FeaturedTag>: The featured tag.
Corresponds to POST /api/v1/featured_tags.
Sourcepub async fn unfeature(&self, id: &str) -> Result<()>
pub async fn unfeature(&self, id: &str) -> Result<()>
Unfeatures a tag from the profile.
Parameters:
id: The ID of the featured tag.
Returns:
Result<()>: Success if the tag was unfeatured.
Corresponds to DELETE /api/v1/featured_tags/:id.
Sourcepub async fn featured_suggestions(&self) -> Result<Vec<Tag>>
pub async fn featured_suggestions(&self) -> Result<Vec<Tag>>
Fetches suggestions for tags to feature.
Returns:
Result<Vec<Tag>>: The suggested tags.
Corresponds to GET /api/v1/featured_tags/suggestions.