pub trait Widget: Send + Sync {
// Required methods
fn code(&self) -> &str;
fn label(&self) -> Text;
fn render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 WidgetCx<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Markup, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn description(&self) -> Option<Text> { ... }
fn permission(&self) -> Option<&str> { ... }
fn size(&self) -> Size { ... }
fn refresh(&self) -> Option<u32> { ... }
}Expand description
A block on the dashboard.
Required Methods§
Sourcefn render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 WidgetCx<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Markup, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 WidgetCx<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Markup, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The widget’s body. An Err renders as a notice inside the frame, never
as a failed page.
Provided Methods§
Sourcefn description(&self) -> Option<Text>
fn description(&self) -> Option<Text>
A line under the label in the Manage dialog.
Sourcefn permission(&self) -> Option<&str>
fn permission(&self) -> Option<&str>
The permission an operator needs to see it; None shows it to every
operator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".