pub enum Direction {
Up,
Down,
Left,
Right,
}Expand description
One of four cardinal scroll directions.
Combined with a crate::motion::MotionRate, a Direction
fully specifies how the visible window slides over a jumbo
background buffer: the rate supplies the speed, the direction
supplies the axis and sign.
Variants§
Up
Content scrolls upward (Star Wars crawl default).
Down
Content scrolls downward.
Left
Content scrolls to the left (news ticker default).
Right
Content scrolls to the right.
Implementations§
Source§impl Direction
impl Direction
Sourcepub const fn is_vertical(self) -> bool
pub const fn is_vertical(self) -> bool
Returns true if this direction is vertical (Up or Down).
Sourcepub const fn is_horizontal(self) -> bool
pub const fn is_horizontal(self) -> bool
Returns true if this direction is horizontal (Left or Right).
Sourcepub const fn sign(self) -> i32
pub const fn sign(self) -> i32
Sign of the scroll offset along the scroll axis.
+1 when the scroll accumulator should grow per frame
(Direction::Down / Direction::Right) and -1 when it
should shrink (Direction::Up / Direction::Left).
Trait Implementations§
impl Copy for Direction
impl Eq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnsafeUnpin for Direction
impl UnwindSafe for Direction
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