pub struct ReportsHandler<'a> { /* private fields */ }Expand description
Handler for report-related API endpoints.
Implementations§
Source§impl<'a> ReportsHandler<'a>
impl<'a> ReportsHandler<'a>
Sourcepub fn new(client: &'a MastodonClient) -> Self
pub fn new(client: &'a MastodonClient) -> Self
Creates a new ReportsHandler for the given client.
Sourcepub async fn list(&self) -> Result<Vec<Report>>
pub async fn list(&self) -> Result<Vec<Report>>
Fetches all reports made by the authenticated user.
Returns:
Result<Vec<Report>>: The reports.
Corresponds to GET /api/v1/reports.
Sourcepub async fn create(
&self,
account_id: &str,
status_ids: Option<&[String]>,
comment: Option<&str>,
forward: Option<bool>,
category: Option<&str>,
rule_ids: Option<&[u32]>,
) -> Result<Report>
pub async fn create( &self, account_id: &str, status_ids: Option<&[String]>, comment: Option<&str>, forward: Option<bool>, category: Option<&str>, rule_ids: Option<&[u32]>, ) -> Result<Report>
Creates a new report.
Parameters:
account_id: The ID of the account being reported.status_ids: IDs of statuses to include in the report.comment: A comment to include with the report.forward: Whether to forward the report to the remote instance.category: The category of the report.rule_ids: IDs of rules that were violated.
Returns:
Result<Report>: The created report.
Corresponds to POST /api/v1/reports.
Auto Trait Implementations§
impl<'a> Freeze for ReportsHandler<'a>
impl<'a> !RefUnwindSafe for ReportsHandler<'a>
impl<'a> Send for ReportsHandler<'a>
impl<'a> Sync for ReportsHandler<'a>
impl<'a> Unpin for ReportsHandler<'a>
impl<'a> !UnwindSafe for ReportsHandler<'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