#[non_exhaustive]pub struct DragStart<T> {
pub payload: T,
pub source: Option<ZoneId>,
pub pointer: Point,
pub grab: Point,
pub effect: DropEffect,
pub mode: DragMode,
pub pointer_kind: PointerKind,
pub source_rect: Option<Rect>,
}Expand description
Complete input for starting a drag with an explicit stable identity.
Construct this with DragStart::new and use the builder methods for
optional metadata. The struct is non-exhaustive so future drag metadata
can be added without breaking downstream callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.payload: T§source: Option<ZoneId>§pointer: Point§grab: Point§effect: DropEffect§mode: DragMode§pointer_kind: PointerKind§source_rect: Option<Rect>Implementations§
Source§impl<T> DragStart<T>
impl<T> DragStart<T>
Sourcepub fn new(payload: T, pointer: Point) -> Self
pub fn new(payload: T, pointer: Point) -> Self
Create a pointer drag at pointer with default grab and move effect.
pub fn with_source(self, source: Option<ZoneId>) -> Self
pub fn with_grab(self, grab: Point) -> Self
pub fn with_effect(self, effect: DropEffect) -> Self
pub fn with_mode(self, mode: DragMode) -> Self
pub fn with_pointer_kind(self, pointer_kind: PointerKind) -> Self
pub fn with_source_rect(self, source_rect: Option<Rect>) -> Self
Trait Implementations§
impl<T: PartialEq> StructuralPartialEq for DragStart<T>
Auto Trait Implementations§
impl<T> Freeze for DragStart<T>where
T: Freeze,
impl<T> RefUnwindSafe for DragStart<T>where
T: RefUnwindSafe,
impl<T> Send for DragStart<T>where
T: Send,
impl<T> Sync for DragStart<T>where
T: Sync,
impl<T> Unpin for DragStart<T>where
T: Unpin,
impl<T> UnsafeUnpin for DragStart<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for DragStart<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.