pub struct FlipOptions<Element: Clone> {
pub detect_overflow: Option<DetectOverflowOptions<Element>>,
pub main_axis: Option<bool>,
pub cross_axis: Option<CrossAxis>,
pub fallback_placements: Option<Vec<Placement>>,
pub fallback_strategy: Option<FallbackStrategy>,
pub fallback_axis_side_direction: Option<Alignment>,
pub flip_alignment: Option<bool>,
}
Expand description
Options for Flip
middleware.
Fields§
§detect_overflow: Option<DetectOverflowOptions<Element>>
Options for detect_overflow
.
Defaults to DetectOverflowOptions::default
.
main_axis: Option<bool>
The axis that runs along the side of the floating element. Determines whether overflow along this axis is checked to perform a flip.
Defaults to true
.
cross_axis: Option<CrossAxis>
The axis that runs along the alignment of the floating element. Determines whether overflow along this axis is checked to perform a flip.
CrossAxis::True
: Whether to check cross axis overflow for both side and alignment flipping.CrossAxis::False
: Whether to disable all cross axis overflow checking.CrossAxis::Alignment
: Whether to check cross axis overflow for alignment flipping only.
Defaults to true
.
fallback_placements: Option<Vec<Placement>>
Placements to try sequentially if the preferred placement
does not fit.
Defaults to the opposite placement.
fallback_strategy: Option<FallbackStrategy>
What strategy to use when no placements fit.
Defaults to FallbackStrategy::BestFit
.
fallback_axis_side_direction: Option<Alignment>
Whether to allow fallback to the perpendicular axis of the preferred placement, and if so, which side direction along the axis to prefer.
Defaults to Option::None
(disallow fallback).
flip_alignment: Option<bool>
Whether to flip to placements with the opposite alignment if they fit better.
Defaults to true
.
Implementations§
Source§impl<Element: Clone> FlipOptions<Element>
impl<Element: Clone> FlipOptions<Element>
Sourcepub fn detect_overflow(self, value: DetectOverflowOptions<Element>) -> Self
pub fn detect_overflow(self, value: DetectOverflowOptions<Element>) -> Self
Set detect_overflow
option.
Sourcepub fn cross_axis(self, value: CrossAxis) -> Self
pub fn cross_axis(self, value: CrossAxis) -> Self
Set cross_axis
option.
Sourcepub fn fallback_placements(self, value: Vec<Placement>) -> Self
pub fn fallback_placements(self, value: Vec<Placement>) -> Self
Set fallback_placements
option.
Sourcepub fn fallback_strategy(self, value: FallbackStrategy) -> Self
pub fn fallback_strategy(self, value: FallbackStrategy) -> Self
Set fallback_strategy
option.
Sourcepub fn fallback_axis_side_direction(self, value: Alignment) -> Self
pub fn fallback_axis_side_direction(self, value: Alignment) -> Self
Set fallback_axis_side_direction
option.
Sourcepub fn flip_alignment(self, value: bool) -> Self
pub fn flip_alignment(self, value: bool) -> Self
Set flip_alignment
option.
Trait Implementations§
Source§impl<Element: Clone + Clone> Clone for FlipOptions<Element>
impl<Element: Clone + Clone> Clone for FlipOptions<Element>
Source§fn clone(&self) -> FlipOptions<Element>
fn clone(&self) -> FlipOptions<Element>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more