pub trait ComponentDefinition: NamedComponent {
type ComponentType: ComponentType;
// Required method
fn default_value(&self, context: &WidgetContext<'_>) -> Self::ComponentType;
}
Expand description
A type that represents a named component with a default value of a specific Rust type.
Required Associated Types§
Sourcetype ComponentType: ComponentType
type ComponentType: ComponentType
The type that will be contained in the Component
.
Required Methods§
Sourcefn default_value(&self, context: &WidgetContext<'_>) -> Self::ComponentType
fn default_value(&self, context: &WidgetContext<'_>) -> Self::ComponentType
Returns the default value to use for this component.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.