#[repr(C)]pub struct ScrollIntoViewOptions {
pub block: ScrollLogicalPosition,
pub inline_axis: ScrollLogicalPosition,
pub behavior: ScrollIntoViewBehavior,
}Expand description
W3C-compliant scroll-into-view options
These options control how an element is scrolled into view, following the CSSOM View Module specification.
Fields§
§block: ScrollLogicalPositionVertical alignment: start, center, end, nearest (default: nearest)
inline_axis: ScrollLogicalPositionHorizontal alignment: start, center, end, nearest (default: nearest)
Note: Named inline_axis to avoid conflict with C keyword inline
behavior: ScrollIntoViewBehaviorAnimation behavior: auto, instant, smooth (default: auto)
Implementations§
Source§impl ScrollIntoViewOptions
impl ScrollIntoViewOptions
Sourcepub fn end() -> Self
pub fn end() -> Self
Create options to align the end of the target with the end of the viewport
Sourcepub fn with_instant(self) -> Self
pub fn with_instant(self) -> Self
Set instant scroll behavior
Sourcepub fn with_smooth(self) -> Self
pub fn with_smooth(self) -> Self
Set smooth scroll behavior
Trait Implementations§
Source§impl Clone for ScrollIntoViewOptions
impl Clone for ScrollIntoViewOptions
Source§fn clone(&self) -> ScrollIntoViewOptions
fn clone(&self) -> ScrollIntoViewOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScrollIntoViewOptions
impl Debug for ScrollIntoViewOptions
Source§impl Default for ScrollIntoViewOptions
impl Default for ScrollIntoViewOptions
Source§fn default() -> ScrollIntoViewOptions
fn default() -> ScrollIntoViewOptions
Returns the “default value” for a type. Read more
Source§impl Hash for ScrollIntoViewOptions
impl Hash for ScrollIntoViewOptions
Source§impl PartialEq for ScrollIntoViewOptions
impl PartialEq for ScrollIntoViewOptions
Source§fn eq(&self, other: &ScrollIntoViewOptions) -> bool
fn eq(&self, other: &ScrollIntoViewOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ScrollIntoViewOptions
impl Eq for ScrollIntoViewOptions
impl StructuralPartialEq for ScrollIntoViewOptions
Auto Trait Implementations§
impl Freeze for ScrollIntoViewOptions
impl RefUnwindSafe for ScrollIntoViewOptions
impl Send for ScrollIntoViewOptions
impl Sync for ScrollIntoViewOptions
impl Unpin for ScrollIntoViewOptions
impl UnsafeUnpin for ScrollIntoViewOptions
impl UnwindSafe for ScrollIntoViewOptions
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