Skip to main content

DragSource

Enum DragSource 

Source
pub enum DragSource<'a, K> {
    SameView {
        key: K,
    },
    Foreign {
        payload: &'a DragPayload,
    },
}
Expand description

Who is dragging, from the receiving source’s point of view.

SameView is an intra-view reorder identified by the dragged row’s key. Foreign is everything else — an in-app drag from another view or an OS drop — carried as a type-erased [DragPayload] the source downcasts itself (e.g. a designer source downcasts to its palette-drop type, a list source to its item type, an OS drop to files). This single distinction is exactly what TabBar already encodes via its source_bar_id.

Variants§

§

SameView

An intra-view reorder; key identifies the dragged row.

Fields

§key: K
§

Foreign

A drag from another view or the OS; downcast payload to interpret it.

Fields

§payload: &'a DragPayload

Auto Trait Implementations§

§

impl<'a, K> !RefUnwindSafe for DragSource<'a, K>

§

impl<'a, K> !Send for DragSource<'a, K>

§

impl<'a, K> !Sync for DragSource<'a, K>

§

impl<'a, K> !UnwindSafe for DragSource<'a, K>

§

impl<'a, K> Freeze for DragSource<'a, K>
where K: Freeze,

§

impl<'a, K> Unpin for DragSource<'a, K>
where K: Unpin,

§

impl<'a, K> UnsafeUnpin for DragSource<'a, K>
where K: UnsafeUnpin,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.