pub struct StatusesHandler<'a> { /* private fields */ }Expand description
Handler for status-related API endpoints.
Implementations§
Source§impl<'a> StatusesHandler<'a>
impl<'a> StatusesHandler<'a>
pub fn new(client: &'a MastodonClient) -> Self
Sourcepub fn builder(&self, text: &str) -> StatusBuilder<'a>
pub fn builder(&self, text: &str) -> StatusBuilder<'a>
Returns a builder for creating a new status.
Sourcepub async fn get(&self, id: &str) -> Result<Status>
pub async fn get(&self, id: &str) -> Result<Status>
Fetches a specific status by its ID.
Parameters:
id: The ID of the status to fetch.
Returns:
Result<Status>: The fetched status.
Corresponds to GET /api/v1/statuses/:id.
Sourcepub async fn create(&self, params: &CreateStatusParams) -> Result<Status>
pub async fn create(&self, params: &CreateStatusParams) -> Result<Status>
Creates a new status.
Parameters:
params: The parameters for the status to create.
Returns:
Result<Status>: The created status.
Corresponds to POST /api/v1/statuses.
Sourcepub async fn create_simple(&self, text: &str) -> Result<Status>
pub async fn create_simple(&self, text: &str) -> Result<Status>
Creates a new status with just text.
Parameters:
text: The text content of the status.
Returns:
Result<Status>: The created status.
This is a convenience method for simple posts.
Sourcepub async fn delete(&self, id: &str) -> Result<Status>
pub async fn delete(&self, id: &str) -> Result<Status>
Deletes a status by its ID.
Parameters:
id: The ID of the status to delete.
Returns:
Result<Status>: The deleted status.
Corresponds to DELETE /api/v1/statuses/:id.
Sourcepub async fn reblog(&self, id: &str) -> Result<Status>
pub async fn reblog(&self, id: &str) -> Result<Status>
Reblogs (boosts) a status.
Parameters:
id: The ID of the status to reblog.
Returns:
Result<Status>: The reblogged status.
Corresponds to POST /api/v1/statuses/:id/reblog.
Sourcepub async fn unreblog(&self, id: &str) -> Result<Status>
pub async fn unreblog(&self, id: &str) -> Result<Status>
Removes a reblog of a status.
Parameters:
id: The ID of the status to unreblog.
Returns:
Result<Status>: The unreblogged status.
Corresponds to POST /api/v1/statuses/:id/unreblog.
Sourcepub async fn favourite(&self, id: &str) -> Result<Status>
pub async fn favourite(&self, id: &str) -> Result<Status>
Favourites a status.
Parameters:
id: The ID of the status to favourite.
Returns:
Result<Status>: The favourited status.
Corresponds to POST /api/v1/statuses/:id/favourite.
Sourcepub async fn unfavourite(&self, id: &str) -> Result<Status>
pub async fn unfavourite(&self, id: &str) -> Result<Status>
Removes a status from favourites.
Parameters:
id: The ID of the status to unfavourite.
Returns:
Result<Status>: The unfavourited status.
Corresponds to POST /api/v1/statuses/:id/unfavourite.
Sourcepub async fn bookmark(&self, id: &str) -> Result<Status>
pub async fn bookmark(&self, id: &str) -> Result<Status>
Bookmarks a status.
Parameters:
id: The ID of the status to bookmark.
Returns:
Result<Status>: The bookmarked status.
Corresponds to POST /api/v1/statuses/:id/bookmark.
Sourcepub async fn unbookmark(&self, id: &str) -> Result<Status>
pub async fn unbookmark(&self, id: &str) -> Result<Status>
Removes a status from bookmarks.
Parameters:
id: The ID of the status to bookmark.
Returns:
Result<Status>: The bookmarked status.
Corresponds to POST /api/v1/statuses/:id/unbookmark.