Struct rerun::external::eframe::egui::DragAndDrop
pub struct DragAndDrop {
payload: Option<Arc<dyn Any + Sync + Send>>,
}
Expand description
Tracking of drag-and-drop payload.
This is a low-level API.
For a higher-level API, see:
crate::Ui::dnd_drag_source
crate::Ui::dnd_drop_zone
crate::Response::dnd_set_drag_payload
crate::Response::dnd_hover_payload
crate::Response::dnd_release_payload
See this example.
Fields§
§payload: Option<Arc<dyn Any + Sync + Send>>
Implementations§
§impl DragAndDrop
impl DragAndDrop
pub fn set_payload<Payload>(ctx: &Context, payload: Payload)
pub fn set_payload<Payload>(ctx: &Context, payload: Payload)
Set a drag-and-drop payload.
This can be read by Self::payload
until the pointer is released.
pub fn clear_payload(ctx: &Context)
pub fn clear_payload(ctx: &Context)
Clears the payload, setting it to None
.
pub fn payload<Payload>(ctx: &Context) -> Option<Arc<Payload>>
pub fn payload<Payload>(ctx: &Context) -> Option<Arc<Payload>>
Retrieve the payload, if any.
Returns None
if there is no payload, or if it is not of the requested type.
Returns Some
both during a drag and on the frame the pointer is released
(if there is a payload).
pub fn take_payload<Payload>(ctx: &Context) -> Option<Arc<Payload>>
pub fn take_payload<Payload>(ctx: &Context) -> Option<Arc<Payload>>
Retrieve and clear the payload, if any.
Returns None
if there is no payload, or if it is not of the requested type.
Returns Some
both during a drag and on the frame the pointer is released
(if there is a payload).
pub fn has_payload_of_type<Payload>(ctx: &Context) -> bool
pub fn has_payload_of_type<Payload>(ctx: &Context) -> bool
Are we carrying a payload of the given type?
Returns true
both during a drag and on the frame the pointer is released
(if there is a payload).
pub fn has_any_payload(ctx: &Context) -> bool
pub fn has_any_payload(ctx: &Context) -> bool
Are we carrying a payload?
Returns true
both during a drag and on the frame the pointer is released
(if there is a payload).
Trait Implementations§
§impl Clone for DragAndDrop
impl Clone for DragAndDrop
§fn clone(&self) -> DragAndDrop
fn clone(&self) -> DragAndDrop
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Default for DragAndDrop
impl Default for DragAndDrop
§fn default() -> DragAndDrop
fn default() -> DragAndDrop
Auto Trait Implementations§
impl Freeze for DragAndDrop
impl !RefUnwindSafe for DragAndDrop
impl Send for DragAndDrop
impl Sync for DragAndDrop
impl Unpin for DragAndDrop
impl !UnwindSafe for DragAndDrop
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request