Skip to main content

SlotFrame

Struct SlotFrame 

Source
pub struct SlotFrame<'k> {
    pub key: &'k str,
    pub rect: Rect,
    pub gestures: Vec<Gesture>,
    pub pointer: Option<(f64, f64)>,
    pub clicked: bool,
    pub pressed: Option<(f64, f64)>,
    pub wheel: (f64, f64),
}
Expand description

One custom-paint slot as the host paints it this frame (DomBuilder::paint_slots, paint_slot).

Fields§

§key: &'k str§rect: Rect

The content box to paint into (window coordinates); painting is clipped to it and to the element’s scroll containers.

§gestures: Vec<Gesture>

The gestures of the fingers the slot captured since the last frame, oldest first, in window coordinates (SlotFrame::local maps a point into the slot).

§pointer: Option<(f64, f64)>

The pointer (mouse, or the finger on the slot) over the slot, z-order safe: None under a popover or a sheet.

§clicked: bool

The slot was clicked or tapped this frame.

§pressed: Option<(f64, f64)>

The pointer while a mouse button holds the slot (a mouse drag), None otherwise. Fingers never set it: their drags are SlotFrame::gestures.

§wheel: (f64, f64)

Mouse-wheel / trackpad scroll over the slot this frame, (dx, dy); a finger’s scroll is not reported here.

Implementations§

Source§

impl SlotFrame<'_>

Source

pub fn local(&self, x: f64, y: f64) -> (f64, f64)

(x, y) relative to the slot’s top-left corner.

Trait Implementations§

Source§

impl<'k> Clone for SlotFrame<'k>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'k> Debug for SlotFrame<'k>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SlotFrame<'static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'k> Forget for SlotFrame<'k>

§

impl<'k> Freeze for SlotFrame<'k>

§

impl<'k> Move for SlotFrame<'k>

§

impl<'k> RefUnwindSafe for SlotFrame<'k>

§

impl<'k> Send for SlotFrame<'k>

§

impl<'k> Sync for SlotFrame<'k>

§

impl<'k> Unpin for SlotFrame<'k>

§

impl<'k> UnsafeUnpin for SlotFrame<'k>

§

impl<'k> UnwindSafe for SlotFrame<'k>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.