pub struct ConversationsHandler<'a> { /* private fields */ }Expand description
Handler for direct conversation (DM) API endpoints.
Implementations§
Source§impl<'a> ConversationsHandler<'a>
impl<'a> ConversationsHandler<'a>
Sourcepub fn new(client: &'a MastodonClient) -> Self
pub fn new(client: &'a MastodonClient) -> Self
Creates a new ConversationsHandler for the given client.
Parameters:
client: The client to use for making requests.
Returns:
ConversationsHandler: The created conversations handler.
Sourcepub async fn list(&self) -> Result<Vec<Conversation>>
pub async fn list(&self) -> Result<Vec<Conversation>>
Fetches a list of the authenticated user’s direct conversations.
Returns:
Result<Vec<Conversation>>: The fetched conversations.
Corresponds to GET /api/v1/conversations.
Sourcepub async fn delete(&self, id: &str) -> Result<()>
pub async fn delete(&self, id: &str) -> Result<()>
Deletes a conversation by its ID.
Parameters:
id: The ID of the conversation to delete.
Returns:
Result<()>: The deleted conversation.
Corresponds to DELETE /api/v1/conversations/:id.
Sourcepub async fn mark_as_read(&self, id: &str) -> Result<Conversation>
pub async fn mark_as_read(&self, id: &str) -> Result<Conversation>
Marks a conversation as read.
Parameters:
id: The ID of the conversation to mark as read.
Returns:
Result<Conversation>: The marked conversation.
Corresponds to POST /api/v1/conversations/:id/read.
Auto Trait Implementations§
impl<'a> Freeze for ConversationsHandler<'a>
impl<'a> !RefUnwindSafe for ConversationsHandler<'a>
impl<'a> Send for ConversationsHandler<'a>
impl<'a> Sync for ConversationsHandler<'a>
impl<'a> Unpin for ConversationsHandler<'a>
impl<'a> !UnwindSafe for ConversationsHandler<'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