Trait cushy::widgets::label::DynamicDisplay

source ·
pub trait DynamicDisplay {
    // Required method
    fn fmt(&self, context: &WidgetContext<'_>, f: &mut Formatter<'_>) -> Result;

    // Provided method
    fn as_display<'display, 'ctx>(
        &'display self,
        context: &'display WidgetContext<'ctx>,
    ) -> DynamicDisplayer<'display, 'ctx>
       where Self: Sized { ... }
}
Expand description

A context-aware Display implementation.

This trait is automatically implemented for all types that implement Display.

Required Methods§

source

fn fmt(&self, context: &WidgetContext<'_>, f: &mut Formatter<'_>) -> Result

Format self with any needed information from context.

Provided Methods§

source

fn as_display<'display, 'ctx>( &'display self, context: &'display WidgetContext<'ctx>, ) -> DynamicDisplayer<'display, 'ctx>
where Self: Sized,

Returns a type that implements Display.

Implementors§