Skip to main content

Report

Trait Report 

Source
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§

Source

fn slug(&self) -> &'static str

URL slug under /cms-admin/report/<slug> + the registry key.

Source

fn title(&self) -> &'static str

Heading + sidebar label.

Source

fn columns(&self) -> Vec<ReportColumn>

The table columns, left to right.

Source

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§

Source

fn description(&self) -> Option<&'static str>

Optional one-line blurb shown under the heading.

Source

fn icon(&self) -> Option<&'static str>

Optional Material Symbols icon name for the sidebar.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§