pub struct NotificationsHandler<'a> { /* private fields */ }Expand description
Handler for notification-related API endpoints.
Implementations§
Source§impl<'a> NotificationsHandler<'a>
impl<'a> NotificationsHandler<'a>
pub fn new(client: &'a MastodonClient) -> Self
Sourcepub async fn list(&self) -> Result<Vec<Notification>>
pub async fn list(&self) -> Result<Vec<Notification>>
Fetches all notifications for the authenticated user.
Returns:
Result<Vec<Notification>>: The fetched notifications.
Corresponds to GET /api/v1/notifications.
Sourcepub async fn get(&self, id: &str) -> Result<Notification>
pub async fn get(&self, id: &str) -> Result<Notification>
Fetches a specific notification by its ID.
Parameters:
id: The ID of the notification to fetch.
Returns:
Result<Notification>: The fetched notification.
Corresponds to GET /api/v1/notifications/:id.
Auto Trait Implementations§
impl<'a> Freeze for NotificationsHandler<'a>
impl<'a> !RefUnwindSafe for NotificationsHandler<'a>
impl<'a> Send for NotificationsHandler<'a>
impl<'a> Sync for NotificationsHandler<'a>
impl<'a> Unpin for NotificationsHandler<'a>
impl<'a> !UnwindSafe for NotificationsHandler<'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