pub trait Report:
Send
+ Sync
+ 'static {
// Required methods
fn slug(&self) -> &'static str;
fn title(&self) -> &'static str;
fn columns(&self) -> Vec<ReportColumn>;
fn rows<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool,
user_id: Option<i64>,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn description(&self) -> Option<&'static str> { ... }
fn icon(&self) -> Option<&'static str> { ... }
}Expand description
A registerable admin report. Implementors are zero-field structs
registered with register_report!.
Required Methods§
Sourcefn columns(&self) -> Vec<ReportColumn>
fn columns(&self) -> Vec<ReportColumn>
The table columns, left to right.
Sourcefn rows<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool,
user_id: Option<i64>,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rows<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool,
user_id: Option<i64>,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Build the rows. Each row is a JSON object keyed by column key;
an optional edit_url key links the first cell. user_id is
the signed-in user (for “your …”-style reports); None for an
unauthenticated context.
Provided Methods§
Sourcefn description(&self) -> Option<&'static str>
fn description(&self) -> Option<&'static str>
Optional one-line blurb shown under the heading.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".