pub struct DraggableCanvas { /* private fields */ }Expand description
A canvas container that allows draggable elements within it.
§Example
fn app() -> impl IntoElement {
DraggableCanvas::new().child(Draggable::new().child("Draggable item"))
}Implementations§
Trait Implementations§
Source§impl ChildrenExt for DraggableCanvas
impl ChildrenExt for DraggableCanvas
Source§fn get_children(&mut self) -> &mut Vec<Element>
fn get_children(&mut self) -> &mut Vec<Element>
Returns a mutable reference to the internal children vector. Read more
Source§fn children(self, children: impl IntoIterator<Item = Element>) -> Self
fn children(self, children: impl IntoIterator<Item = Element>) -> Self
Source§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 Component for DraggableCanvas
impl Component for DraggableCanvas
fn render(&self) -> impl IntoElement
fn render_key(&self) -> DiffKey
Source§impl ContainerExt for DraggableCanvas
impl ContainerExt for DraggableCanvas
Source§fn position(self, position: impl Into<Position>) -> Self
fn position(self, position: impl Into<Position>) -> Self
Set how the element is placed relative to its parent or the window. See
Position.Source§fn padding(self, padding: impl Into<Gaps>) -> Self
fn padding(self, padding: impl Into<Gaps>) -> Self
Set the inner spacing between the element’s edges and its content. See
Gaps.Source§fn margin(self, margin: impl Into<Gaps>) -> Self
fn margin(self, margin: impl Into<Gaps>) -> Self
Set the outer spacing between the element’s edges and its surroundings. See
Gaps.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 Default for DraggableCanvas
impl Default for DraggableCanvas
Source§impl KeyExt for DraggableCanvas
impl KeyExt for DraggableCanvas
Source§impl LayoutExt for DraggableCanvas
impl LayoutExt for DraggableCanvas
Source§fn get_layout(&mut self) -> &mut LayoutData
fn get_layout(&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.Source§impl PartialEq for DraggableCanvas
impl PartialEq for DraggableCanvas
impl StructuralPartialEq for DraggableCanvas
Auto Trait Implementations§
impl Freeze for DraggableCanvas
impl !RefUnwindSafe for DraggableCanvas
impl !Send for DraggableCanvas
impl !Sync for DraggableCanvas
impl Unpin for DraggableCanvas
impl UnsafeUnpin for DraggableCanvas
impl !UnwindSafe for DraggableCanvas
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> 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> ContainerSizeExt for Twhere
T: ContainerExt,
impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
§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>
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