pub trait SegmentedVariant {
// Required methods
fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance;
fn variant_bounds<'b>(
&'b self,
state: &'b LocalState,
bounds: Rectangle,
) -> Box<dyn Iterator<Item = ItemBounds> + 'b>;
fn variant_layout(
&self,
state: &mut LocalState,
renderer: &Renderer,
limits: &Limits,
) -> Size;
}
Expand description
Isolates variant-specific behaviors from SegmentedButton
.
Required Methods§
Sourcefn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
Get the appearance for this variant of the widget.
Sourcefn variant_bounds<'b>(
&'b self,
state: &'b LocalState,
bounds: Rectangle,
) -> Box<dyn Iterator<Item = ItemBounds> + 'b>
fn variant_bounds<'b>( &'b self, state: &'b LocalState, bounds: Rectangle, ) -> Box<dyn Iterator<Item = ItemBounds> + 'b>
Calculates the bounds for visible buttons.
Sourcefn variant_layout(
&self,
state: &mut LocalState,
renderer: &Renderer,
limits: &Limits,
) -> Size
fn variant_layout( &self, state: &mut LocalState, renderer: &Renderer, limits: &Limits, ) -> Size
Calculates the layout of this variant.
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.