pub struct DropZone<T: 'static + PartialEq + Clone> { /* private fields */ }Expand description
Implementations§
Source§impl<T: PartialEq + Clone + 'static> DropZone<T>
impl<T: PartialEq + Clone + 'static> DropZone<T>
Sourcepub fn new(on_drop: impl Into<EventHandler<T>>) -> Self
pub fn new(on_drop: impl Into<EventHandler<T>>) -> Self
Create a drop zone, on_drop is called with the payload of the released DragZone.
Sourcepub fn on_drag_over(self, on_drag_over: impl Into<EventHandler<bool>>) -> Self
pub fn on_drag_over(self, on_drag_over: impl Into<EventHandler<bool>>) -> Self
Called with true when a drag enters this zone and false when it leaves or is dropped.
Only fires while a drag of T is in progress, so it is handy for showing drop previews.
Trait Implementations§
Source§impl<T: Clone + PartialEq + 'static> ChildrenExt for DropZone<T>
impl<T: Clone + PartialEq + 'static> ChildrenExt for DropZone<T>
Source§fn children_mut(&mut self) -> &mut Vec<Element>
fn children_mut(&mut self) -> &mut Vec<Element>
Returns a mutable reference to the internal children vector. Read more
Source§fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
Extends the children with an iterable of anything that implements
IntoElement. Read moreSource§fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
Source§fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
Appends a single child element. Read more
Source§impl<T: Clone + PartialEq + 'static> Component for DropZone<T>
impl<T: Clone + PartialEq + 'static> Component for DropZone<T>
fn render(&self) -> impl IntoElement
fn render_key(&self) -> DiffKey
Source§impl<T: Clone + PartialEq + 'static> LayoutExt for DropZone<T>
impl<T: Clone + PartialEq + 'static> LayoutExt for DropZone<T>
Source§fn layout_mut(&mut self) -> &mut LayoutData
fn layout_mut(&mut self) -> &mut LayoutData
Returns a mutable reference to the element’s layout data.
Source§fn layout(self, layout: LayoutData) -> Self
fn layout(self, layout: LayoutData) -> Self
Replace all of the element’s layout data at once. See
LayoutData.impl<T: PartialEq + 'static + PartialEq + Clone> StructuralPartialEq for DropZone<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DropZone<T>
impl<T> !Send for DropZone<T>
impl<T> !Sync for DropZone<T>
impl<T> !UnwindSafe for DropZone<T>
impl<T> Forget for DropZone<T>
impl<T> Freeze for DropZone<T>where
EventHandler<T>: Freeze,
impl<T> Unpin for DropZone<T>where
EventHandler<T>: Unpin,
impl<T> UnsafeUnpin for DropZone<T>where
EventHandler<T>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ComponentKey for Twhere
T: Component,
impl<T> ComponentKey for Twhere
T: Component,
fn default_key(&self) -> DiffKey
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
Source§fn min_width(self, minimum_width: impl Into<Size>) -> Self
fn min_width(self, minimum_width: impl Into<Size>) -> Self
Set the minimum width the element can shrink to. See
Size.Source§fn min_height(self, minimum_height: impl Into<Size>) -> Self
fn min_height(self, minimum_height: impl Into<Size>) -> Self
Set the minimum height the element can shrink to. See
Size.Source§fn max_width(self, maximum_width: impl Into<Size>) -> Self
fn max_width(self, maximum_width: impl Into<Size>) -> Self
Set the maximum width the element can grow to. See
Size.Source§fn max_height(self, maximum_height: impl Into<Size>) -> Self
fn max_height(self, maximum_height: impl Into<Size>) -> Self
Set the maximum height the element can grow to. See
Size.Source§fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
Set how much of the measured width is actually used in layout. See
VisibleSize.Source§fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
Set how much of the measured height is actually used in layout. See
VisibleSize.Source§impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
Source§impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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 more