pub struct FlipOptions<Element: Clone> {
pub detect_overflow: Option<DetectOverflowOptions<Element>>,
pub main_axis: Option<bool>,
pub cross_axis: Option<bool>,
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<bool>The axis that runs along the alignment of the floating element. Determines whether overflow along this axis is checked to perform a flip.
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: bool) -> Self
pub fn cross_axis(self, value: bool) -> 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 moreSource§impl<Element: Clone> Default for FlipOptions<Element>
impl<Element: Clone> Default for FlipOptions<Element>
Source§impl<Element: Clone, Window: Clone> MiddlewareWithOptions<Element, Window, FlipOptions<Element>> for Flip<'_, Element, Window>
impl<Element: Clone, Window: Clone> MiddlewareWithOptions<Element, Window, FlipOptions<Element>> for Flip<'_, Element, Window>
Source§fn options(&self) -> &Derivable<'_, Element, Window, FlipOptions<Element>>
fn options(&self) -> &Derivable<'_, Element, Window, FlipOptions<Element>>
impl<Element: Clone> StructuralPartialEq for FlipOptions<Element>
Auto Trait Implementations§
impl<Element> Freeze for FlipOptions<Element>where
Element: Freeze,
impl<Element> RefUnwindSafe for FlipOptions<Element>where
Element: RefUnwindSafe,
impl<Element> Send for FlipOptions<Element>where
Element: Send,
impl<Element> Sync for FlipOptions<Element>where
Element: Sync,
impl<Element> Unpin for FlipOptions<Element>where
Element: Unpin,
impl<Element> UnwindSafe for FlipOptions<Element>where
Element: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)