pub trait DynamicDisplay {
// Required method
fn fmt(&self, context: &WidgetContext<'_>, f: &mut Formatter<'_>) -> Result;
// Provided methods
fn generation(&self, context: &WidgetContext<'_>) -> Option<Generation> { ... }
fn as_display<'display, 'ctx>(
&'display self,
context: &'display WidgetContext<'ctx>,
) -> DynamicDisplayer<'display, 'ctx>
where Self: Sized { ... }
fn into_label(self) -> Label<Self>
where Self: Debug + Sized + Send + 'static { ... }
fn to_label(&self) -> Label<Self>
where Self: Clone + Debug + Sized + Send + 'static { ... }
}
Expand description
Required Methods§
sourcefn fmt(&self, context: &WidgetContext<'_>, f: &mut Formatter<'_>) -> Result
fn fmt(&self, context: &WidgetContext<'_>, f: &mut Formatter<'_>) -> Result
Format self
with any needed information from context
.
Provided Methods§
sourcefn generation(&self, context: &WidgetContext<'_>) -> Option<Generation>
fn generation(&self, context: &WidgetContext<'_>) -> Option<Generation>
Returns a generation representing the current state of the dynamic.
To ensure the contents are recached by a Label
widget, return a
unique value from this function each time the contents are updated.
sourcefn as_display<'display, 'ctx>(
&'display self,
context: &'display WidgetContext<'ctx>,
) -> DynamicDisplayer<'display, 'ctx>where
Self: Sized,
fn as_display<'display, 'ctx>(
&'display self,
context: &'display WidgetContext<'ctx>,
) -> DynamicDisplayer<'display, 'ctx>where
Self: Sized,
Returns a type that implements Display
.
sourcefn into_label(self) -> Label<Self>
fn into_label(self) -> Label<Self>
Returns self
being Display
ed in a Label
widget.