[][src]Struct drag_controller::DragController

pub struct DragController {
    pub drag: bool,
    pub pos: [f64; 2],
}

Controls dragging.

Fields

drag: bool

Whether to drag or not.

pos: [f64; 2]

The current positon of dragging.

Implementations

impl DragController[src]

pub fn new() -> DragController[src]

Creates a new drag controller.

pub fn event<E: GenericEvent, F>(&mut self, e: &E, f: F) where
    F: FnMut(Drag) -> bool
[src]

Handles event.

Calls closure when events for dragging happen. If the drag event callback returns false, it will cancel dragging.

Trait Implementations

impl Clone for DragController[src]

impl Copy for DragController[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.