pub struct ShiftOptions<Element: Clone + 'static, Window: Clone + 'static> {
pub detect_overflow: Option<DetectOverflowOptions<Element>>,
pub main_axis: Option<bool>,
pub cross_axis: Option<bool>,
pub limiter: Option<Box<dyn Limiter<Element, Window>>>,
}
Expand description
Options for Shift
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 alignment of the floating element. Determines whether overflow along this axis is checked to perform shifting.
Defaults to true
.
cross_axis: Option<bool>
The axis that runs along the side of the floating element. Determines whether overflow along this axis is checked to perform shifting.
Defaults to false
.
limiter: Option<Box<dyn Limiter<Element, Window>>>
Accepts a limiter that limits the shifting done in order to prevent detachment.
Defaults to DefaultLimiter
.
Implementations§
Source§impl<Element: Clone, Window: Clone> ShiftOptions<Element, Window>
impl<Element: Clone, Window: Clone> ShiftOptions<Element, Window>
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.
Trait Implementations§
Source§impl<Element: Clone + Clone + 'static, Window: Clone + Clone + 'static> Clone for ShiftOptions<Element, Window>
impl<Element: Clone + Clone + 'static, Window: Clone + Clone + 'static> Clone for ShiftOptions<Element, Window>
Source§fn clone(&self) -> ShiftOptions<Element, Window>
fn clone(&self) -> ShiftOptions<Element, Window>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Element: Clone, Window: Clone> MiddlewareWithOptions<Element, Window, ShiftOptions<Element, Window>> for Shift<'_, Element, Window>
impl<Element: Clone, Window: Clone> MiddlewareWithOptions<Element, Window, ShiftOptions<Element, Window>> for Shift<'_, Element, Window>
Source§fn options(
&self,
) -> &Derivable<'_, Element, Window, ShiftOptions<Element, Window>>
fn options( &self, ) -> &Derivable<'_, Element, Window, ShiftOptions<Element, Window>>
The options passed to this middleware.
Source§impl<Element: PartialEq + Clone + 'static, Window: PartialEq + Clone + 'static> PartialEq for ShiftOptions<Element, Window>
impl<Element: PartialEq + Clone + 'static, Window: PartialEq + Clone + 'static> PartialEq for ShiftOptions<Element, Window>
Source§fn eq(&self, other: &ShiftOptions<Element, Window>) -> bool
fn eq(&self, other: &ShiftOptions<Element, Window>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl<Element: Clone + 'static, Window: Clone + 'static> StructuralPartialEq for ShiftOptions<Element, Window>
Auto Trait Implementations§
impl<Element, Window> Freeze for ShiftOptions<Element, Window>where
Element: Freeze,
impl<Element, Window> !RefUnwindSafe for ShiftOptions<Element, Window>
impl<Element, Window> !Send for ShiftOptions<Element, Window>
impl<Element, Window> !Sync for ShiftOptions<Element, Window>
impl<Element, Window> Unpin for ShiftOptions<Element, Window>where
Element: Unpin,
impl<Element, Window> !UnwindSafe for ShiftOptions<Element, Window>
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
Mutably borrows from an owned value. Read more