Skip to main content

ResizeHandle

Struct ResizeHandle 

Source
pub struct ResizeHandle<T, E>
where T: 'static, E: 'static + Render,
{ /* private fields */ }
Expand description

A band that resizes along one axis when it is dragged, carrying a T that the drag renders as an E. See resize_handle.

Implementations§

Source§

impl<T, E> ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source

pub fn with_appearance( self, appearance: Rc<dyn Fn(&ResizeHandleContext, &mut Window, &mut App) -> Option<AnyElement>>, ) -> ResizeHandle<T, E>

Hand the painted part of this handle to appearance.

Source

pub fn on_drag( self, value: T, f: impl Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E> + 'static, ) -> ResizeHandle<T, E>

Start a drag carrying value when the band is pressed and moved.

A band takes one drag, and this is it: use this rather than StatefulInteractiveElement::on_drag, which it shadows.

GPUI tells drags apart by the type of their payload, so the drag carries value itself, and a caller following it with on_drag_move listens for a T.

Source

pub fn inside(self, edge: HandleEdge) -> ResizeHandle<T, E>

Keep the whole handle inside its container, hugging edge, instead of straddling the boundary it resizes.

Trait Implementations§

Source§

impl<T, E> Element for ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source§

type PrepaintState = Hitbox

The band’s own hitbox, so the listeners in paint can ask whether the pointer is really on the handle rather than merely within its bounds.

Source§

type RequestLayoutState = AnyElement

The type of state returned from Element::request_layout. A mutable reference to this state is subsequently provided to Element::prepaint and Element::paint.
Source§

fn id(&self) -> Option<ElementId>

If this element has a unique identifier, return it here. This is used to track elements across frames, and will cause a GlobalElementId to be passed to the request_layout, prepaint, and paint methods. Read more
Source§

fn source_location(&self) -> Option<&'static Location<'static>>

Source location where this element was constructed, used to disambiguate elements in the inspector and navigate to their source code.
Source§

fn request_layout( &mut self, id: Option<&GlobalElementId>, _: Option<&InspectorElementId>, window: &mut Window, cx: &mut App, ) -> (LayoutId, <ResizeHandle<T, E> as Element>::RequestLayoutState)

Before an element can be painted, we need to know where it’s going to be and how big it is. Use this method to request a layout from Taffy and initialize the element’s state.
Source§

fn prepaint( &mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, bounds: Bounds<Pixels>, request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState, window: &mut Window, cx: &mut App, ) -> <ResizeHandle<T, E> as Element>::PrepaintState

After laying out an element, we need to commit its bounds to the current frame for hitbox purposes. The state argument is the same state that was returned from Element::request_layout().
Source§

fn paint( &mut self, id: Option<&GlobalElementId>, _: Option<&InspectorElementId>, _: Bounds<Pixels>, request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState, hitbox: &mut <ResizeHandle<T, E> as Element>::PrepaintState, window: &mut Window, cx: &mut App, )

Once layout has been completed, this method will be called to paint the element to the screen. The state argument is the same state that was returned from Element::request_layout().
Source§

fn a11y_role(&self) -> Option<Role>

Returns the accessible role for this element, if any. Elements that return None are not included in the accessibility tree. Read more
Source§

fn write_a11y_info(&self, _node: &mut Node)

Write accessibility properties to the given node. Called only when a11y_role() returns Some. Read more
Source§

fn a11y_synthetic_children( &mut self, _prepaint: &mut Self::PrepaintState, _builder: &mut A11ySubtreeBuilder<'_>, )

Add synthetic child nodes to an Element that has an .id() and a .role(). Read more
Source§

fn into_any(self) -> AnyElement

Convert this element into a dynamically-typed AnyElement.
Source§

impl<T, E> InteractiveElement for ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source§

fn interactivity(&mut self) -> &mut Interactivity

Retrieve the interactivity state associated with this element
Source§

fn group(self, group: impl Into<SharedString>) -> Self

Assign this element to a group of elements that can be styled together
Source§

fn id(self, id: impl Into<ElementId>) -> Stateful<Self>

Assign this element an ID, so that it can be used with interactivity
Source§

fn track_focus(self, focus_handle: &FocusHandle) -> Self

Track the focus state of the given focus handle on this element. If the focus handle is focused by the application, this element will apply its focused styles.
Source§

fn tab_stop(self, tab_stop: bool) -> Self

Set whether this element is a tab stop. Read more
Source§

fn tab_index(self, index: isize) -> Self

Set index of the tab stop order, and set this node as a tab stop. This will default the element to being a tab stop. See Self::tab_stop for more information. This should only be used in conjunction with tab_group in order to not interfere with the tab index of other elements.
Source§

fn tab_group(self) -> Self

Designate this div as a “tab group”. Tab groups have their own location in the tab-index order, but for children of the tab group, the tab index is reset to 0. This can be useful for swapping the order of tab stops within the group, without having to renumber all the tab stops in the whole application.
Source§

fn key_context<C, E>(self, key_context: C) -> Self
where C: TryInto<KeyContext, Error = E>, E: Display,

Set the keymap context for this element. This will be used to determine which action to dispatch from the keymap.
Source§

fn hover(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self

Apply the given style to this element when the mouse hovers over it
Source§

fn group_hover( self, group_name: impl Into<SharedString>, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self

Apply the given style to this element when the mouse hovers over a group member
Source§

fn on_mouse_down( self, button: MouseButton, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse down event for the given mouse button. The fluent API equivalent to Interactivity::on_mouse_down. Read more
Source§

fn debug_selector(self, _: impl FnOnce() -> String) -> Self

Set a key that can be used to look up this element’s bounds in the [crate::VisualTestContext::debug_bounds] map. Read more
Source§

fn capture_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse down event for any button, during the capture phase. The fluent API equivalent to Interactivity::capture_any_mouse_down. Read more
Source§

fn on_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse down event for any button, during the capture phase. The fluent API equivalent to Interactivity::on_any_mouse_down. Read more
Source§

fn on_mouse_up( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse up event for the given button, during the bubble phase. The fluent API equivalent to Interactivity::on_mouse_up. Read more
Source§

fn capture_any_mouse_up( self, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse up event for any button, during the capture phase. The fluent API equivalent to Interactivity::capture_any_mouse_up. Read more
Source§

fn on_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse pressure event, during the bubble phase the fluent API equivalent to Interactivity::on_mouse_pressure Read more
Source§

fn capture_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse pressure event, during the capture phase the fluent API equivalent to Interactivity::on_mouse_pressure Read more
Source§

fn on_mouse_down_out( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse down event, on any button, during the capture phase, when the mouse is outside of the bounds of this element. The fluent API equivalent to Interactivity::on_mouse_down_out. Read more
Source§

fn on_mouse_up_out( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse up event, for the given button, during the capture phase, when the mouse is outside of the bounds of this element. The fluent API equivalent to Interactivity::on_mouse_up_out. Read more
Source§

fn on_mouse_move( self, listener: impl Fn(&MouseMoveEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse move event, during the bubble phase. The fluent API equivalent to Interactivity::on_mouse_move. Read more
Source§

fn on_mouse_exit( self, listener: impl Fn(&MouseExitEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to the mouse exit event, during the bubble phase. The fluent API equivalent to Interactivity::on_mouse_exit. Read more
Source§

fn on_file_drop_exit( self, listener: impl Fn(&FileDropEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to FileDropEvent::Exited when a platform file drag leaves this element’s window while the element is hovered. Read more
Source§

fn on_drag_move<T>( self, listener: impl Fn(&DragMoveEvent<T>, &mut Window, &mut App) + 'static, ) -> Self
where T: 'static,

Bind the given callback to the mouse drag event of the given type. Note that this will be called for all move events, inside or outside of this element, as long as the drag was started with this element under the mouse. Useful for implementing draggable UIs that don’t conform to a drag and drop style interaction, like resizing. The fluent API equivalent to Interactivity::on_drag_move. Read more
Source§

fn on_scroll_wheel( self, listener: impl Fn(&ScrollWheelEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to scroll wheel events during the bubble phase. The fluent API equivalent to Interactivity::on_scroll_wheel. Read more
Source§

fn on_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to pinch gesture events during the bubble phase. The fluent API equivalent to Interactivity::on_pinch. Read more
Source§

fn capture_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to pinch gesture events during the capture phase. The fluent API equivalent to Interactivity::capture_pinch. Read more
Source§

fn capture_action<A>( self, listener: impl Fn(&A, &mut Window, &mut App) + 'static, ) -> Self
where A: Action,

Capture the given action, before normal action dispatch can fire. The fluent API equivalent to Interactivity::capture_action. Read more
Source§

fn on_action<A>( self, listener: impl Fn(&A, &mut Window, &mut App) + 'static, ) -> Self
where A: Action,

Bind the given callback to an action dispatch during the bubble phase. The fluent API equivalent to Interactivity::on_action. Read more
Source§

fn on_boxed_action( self, action: &(dyn Action + 'static), listener: impl Fn(&(dyn Action + 'static), &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to an action dispatch, based on a dynamic action parameter instead of a type parameter. Useful for component libraries that want to expose action bindings to their users. The fluent API equivalent to Interactivity::on_boxed_action. Read more
Source§

fn on_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to key down events during the bubble phase. The fluent API equivalent to Interactivity::on_key_down. Read more
Source§

fn capture_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to key down events during the capture phase. The fluent API equivalent to Interactivity::capture_key_down. Read more
Source§

fn on_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to key up events during the bubble phase. The fluent API equivalent to Interactivity::on_key_up. Read more
Source§

fn capture_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to key up events during the capture phase. The fluent API equivalent to Interactivity::capture_key_up. Read more
Source§

fn on_modifiers_changed( self, listener: impl Fn(&ModifiersChangedEvent, &mut Window, &mut App) + 'static, ) -> Self

Bind the given callback to modifiers changing events. The fluent API equivalent to Interactivity::on_modifiers_changed. Read more
Source§

fn drag_over<S>( self, f: impl Fn(StyleRefinement, &S, &mut Window, &mut App) -> StyleRefinement + 'static, ) -> Self
where S: 'static,

Apply the given style when the given data type is dragged over this element
Source§

fn group_drag_over<S>( self, group_name: impl Into<SharedString>, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self
where S: 'static,

Apply the given style when the given data type is dragged over this element’s group
Source§

fn on_drop<T>( self, listener: impl Fn(&T, &mut Window, &mut App) + 'static, ) -> Self
where T: 'static,

Bind the given callback to drop events of the given type, whether or not the drag started on this element. The fluent API equivalent to Interactivity::on_drop. Read more
Source§

fn can_drop( self, predicate: impl Fn(&(dyn Any + 'static), &mut Window, &mut App) -> bool + 'static, ) -> Self

Use the given predicate to determine whether or not a drop event should be dispatched to this element. The fluent API equivalent to Interactivity::can_drop.
Source§

fn occlude(self) -> Self

Block the mouse from all interactions with elements behind this element’s hitbox. Typically block_mouse_except_scroll should be preferred. The fluent API equivalent to Interactivity::occlude_mouse.
Source§

fn window_control_area(self, area: WindowControlArea) -> Self

Set the bounds of this element as a window control area for the platform window. The fluent API equivalent to Interactivity::window_control_area.
Source§

fn block_mouse_except_scroll(self) -> Self

Block non-scroll mouse interactions with elements behind this element’s hitbox. The fluent API equivalent to Interactivity::block_mouse_except_scroll. Read more
Source§

fn focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
where Self: Sized,

Set the given styles to be applied when this element, specifically, is focused. Requires that the element is focusable. Elements can be made focusable using InteractiveElement::track_focus.
Source§

fn in_focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
where Self: Sized,

Set the given styles to be applied when this element is inside another element that is focused. Requires that the element is focusable. Elements can be made focusable using InteractiveElement::track_focus.
Source§

fn focus_visible( self, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self
where Self: Sized,

Set the given styles to be applied when this element is focused via keyboard navigation. This is similar to CSS’s :focus-visible pseudo-class - it only applies when the element is focused AND the user is navigating via keyboard (not mouse clicks). Requires that the element is focusable. Elements can be made focusable using InteractiveElement::track_focus.
Source§

impl<T, E> InteractiveElementExt for ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source§

fn lock_scroll_axis(self) -> Self

Locks scrolling to the gesture’s dominant axis, where the platform supports it. See OngoingScrollExt for why this is a no-op on wasm32.
Source§

fn on_double_click( self, listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self
where Self: Sized,

Set the listener for a double click event.
Source§

impl<T, E> IntoElement for ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source§

type Element = ResizeHandle<T, E>

The specific type of element into which the implementing type is converted. Useful for converting other types into elements automatically, like Strings
Source§

fn into_element(self) -> <ResizeHandle<T, E> as IntoElement>::Element

Convert self into a type that implements Element.
Source§

fn into_any_element(self) -> AnyElement

Convert self into a dynamically-typed AnyElement.
Source§

impl<T, E> StatefulInteractiveElement for ResizeHandle<T, E>
where T: 'static, E: 'static + Render,

Source§

fn role(self, role: Role) -> Self

Set the accessible role for this element. Read more
Source§

fn accessibility_id(self, id: impl Into<SharedString>) -> Self

Set the author-provided identifier exposed to accessibility clients. Read more
Source§

fn aria_label(self, label: impl Into<SharedString>) -> Self

Set the accessible label for this element.
Source§

fn aria_description(self, description: impl Into<SharedString>) -> Self

Set the accessible description for this element. Unlike the label (which names the element), the description provides supplementary information that assistive technology announces after the name, role, and value - for example a settings subtitle or a hint.
Source§

fn aria_keyshortcuts(self, keyshortcuts: impl Into<SharedString>) -> Self

Set the keyboard shortcut(s) that activate this element, announced by assistive technology (maps to AccessKit’s keyboard_shortcut). Read more
Source§

fn aria_active_descendant(self) -> Self

Report this element as the focused node in the accessibility tree, overriding the element that holds real keyboard focus — but only while one of its ancestors actually holds focus. Read more
Source§

fn a11y_synthetic_children( self, f: impl FnOnce(&mut A11ySubtreeBuilder<'_>) + 'static, ) -> Self

Contribute synthetic accessibility nodes — nodes that don’t correspond to any element — as children of this element’s a11y node. For example, text runs describing an editor’s text content. Read more
Source§

fn aria_selected(self, selected: bool) -> Self

Set the selected state for this element.
Source§

fn aria_expanded(self, expanded: bool) -> Self

Set the expanded state for this element.
Source§

fn aria_toggled(self, toggled: Toggled) -> Self

Set the toggled state for this element.
Source§

fn aria_numeric_value(self, value: f64) -> Self

Set the numeric value for this element.
Source§

fn aria_numeric_value_step(self, step: f64) -> Self

Set the step by which assistive technology should expect the numeric value of this element to change (e.g. when incrementing a spin button).
Source§

fn aria_value(self, value: impl Into<SharedString>) -> Self

Set the string value of this element, e.g. the text content of a simple text input.
Source§

fn aria_placeholder(self, placeholder: impl Into<SharedString>) -> Self

Set the placeholder text reported to assistive technology for this element, shown when a text input is empty.
Source§

fn aria_min_numeric_value(self, value: f64) -> Self

Set the minimum numeric value for this element.
Source§

fn aria_max_numeric_value(self, value: f64) -> Self

Set the maximum numeric value for this element.
Source§

fn aria_orientation(self, orientation: Orientation) -> Self

Set the orientation of this element.
Source§

fn aria_level(self, level: usize) -> Self

Set the heading level of this element.
Source§

fn aria_position_in_set(self, position: usize) -> Self

Set the position in set of this element.
Source§

fn aria_size_of_set(self, size: usize) -> Self

Set the size of set for this element.
Source§

fn aria_row_index(self, index: usize) -> Self

Set the row index for this element.
Source§

fn aria_column_index(self, index: usize) -> Self

Set the column index for this element.
Source§

fn aria_row_count(self, count: usize) -> Self

Set the row count for this element.
Source§

fn aria_column_count(self, count: usize) -> Self

Set the column count for this element.
Source§

fn on_a11y_action( self, action: Action, listener: impl FnMut(Option<&ActionData>, &mut Window, &mut App) + 'static, ) -> Self

Register a handler for an accessibility action on this element. The handler is called when a screen reader requests the given action. Read more
Source§

fn focusable(self) -> Self

Set this element to focusable.
Source§

fn overflow_scroll(self) -> Self

Set the overflow x and y to scroll.
Source§

fn overflow_x_scroll(self) -> Self

Set the overflow x to scroll.
Source§

fn overflow_y_scroll(self) -> Self

Set the overflow y to scroll.
Source§

fn restrict_scroll_to_axis(self) -> Self

Restrict scrolling of this element to the axis of the input gesture. Read more
Source§

fn track_scroll(self, scroll_handle: &ScrollHandle) -> Self

Track the scroll state of this element with the given handle.
Source§

fn anchor_scroll(self, scroll_anchor: Option<ScrollAnchor>) -> Self

Track the scroll state of this element with the given handle.
Source§

fn active(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
where Self: Sized,

Set the given styles to be applied when this element is active.
Source§

fn group_active( self, group_name: impl Into<SharedString>, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self
where Self: Sized,

Set the given styles to be applied when this element’s group is active.
Source§

fn on_click( self, listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self
where Self: Sized,

Bind the given callback to click events of this element. The fluent API equivalent to Interactivity::on_click. Read more
Source§

fn on_aux_click( self, listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self
where Self: Sized,

Bind the given callback to non-primary click events of this element. The fluent API equivalent to Interactivity::on_aux_click. Read more
Source§

fn on_drag<T, W>( self, value: T, constructor: impl Fn(&T, Point<Pixels>, &mut Window, &mut App) -> Entity<W> + 'static, ) -> Self
where Self: Sized, T: 'static, W: 'static + Render,

On drag initiation, this callback will be used to create a new view to render the dragged value for a drag and drop operation. This API should also be used as the equivalent of ‘on drag start’ with the InteractiveElement::on_drag_move API. The callback also has access to the offset of triggering click from the origin of parent element. The fluent API equivalent to Interactivity::on_drag. Read more
Source§

fn external_drag_payload<T>( self, resolver: impl Fn(&T, &mut Window, &mut App) -> Option<ExternalDragPayload> + 'static, ) -> Self
where Self: Sized, T: 'static,

Registers a callback resolving a payload to offer the platform if a drag started by this element leaves the window. It is invoked at most once per drag gesture, when the pointer exits the viewport. Must be called after Self::on_drag, with the same dragged value type T. The fluent API equivalent to Interactivity::external_drag_payload.
Source§

fn on_hover( self, listener: impl Fn(&bool, &mut Window, &mut App) + 'static, ) -> Self
where Self: Sized,

Bind the given callback on the hover start and end events of this element. Note that the boolean passed to the callback is true when the hover starts and false when it ends. Transitions caused by layout changes under a stationary mouse also invoke the callback. Read more
Source§

fn hover_listener_mode(self, mode: HoverListenerMode) -> Self
where Self: Sized,

Sets how Self::on_hover responds to key presses while the mouse is stationary. This affects only the hover listener, not hover styles or tooltips. The fluent API equivalent to Interactivity::hover_listener_mode.
Source§

fn tooltip( self, build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static, ) -> Self
where Self: Sized,

Constructs a tooltip when the element is hovered or long-pressed. The fluent API equivalent to Interactivity::tooltip.
Source§

fn hoverable_tooltip( self, build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static, ) -> Self
where Self: Sized,

Constructs a tooltip when the element is hovered or long-pressed. The tooltip itself is also hoverable and won’t disappear when the user moves the mouse into the tooltip. The fluent API equivalent to Interactivity::hoverable_tooltip.
Source§

fn tooltip_show_delay(self, delay: Duration) -> Self
where Self: Sized,

Sets the delay before this element’s tooltip is shown on hover. Read more

Auto Trait Implementations§

§

impl<T, E> !RefUnwindSafe for ResizeHandle<T, E>

§

impl<T, E> !Send for ResizeHandle<T, E>

§

impl<T, E> !Sync for ResizeHandle<T, E>

§

impl<T, E> !UnwindSafe for ResizeHandle<T, E>

§

impl<T, E> Freeze for ResizeHandle<T, E>
where Option<(T, Box<dyn Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E>>)>: Freeze,

§

impl<T, E> Unpin for ResizeHandle<T, E>
where Option<(T, Box<dyn Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E>>)>: Unpin,

§

impl<T, E> UnsafeUnpin for ResizeHandle<T, E>
where Option<(T, Box<dyn Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E>>)>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<E> AnimationExt for E
where E: IntoElement + 'static,

Source§

fn with_animation( self, id: impl Into<ElementId>, animation: Animation, animator: impl Fn(Self, f32) -> Self + 'static, ) -> AnimationElement<Self>
where Self: Sized,

Render this component or element with an animation
Source§

fn with_animations( self, id: impl Into<ElementId>, animations: Vec<Animation>, animator: impl Fn(Self, usize, f32) -> Self + 'static, ) -> AnimationElement<Self>
where Self: Sized,

Render this component or element with a chain of animations
Source§

fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
where Self: Sized, T: SpringTarget, <T as SpringTarget>::Output: 'static,

Renders this component or element at the value produced by a spring. Read more
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> FluentBuilder for T
where T: IntoElement,

Source§

fn map<U>(self, f: impl FnOnce(Self) -> U) -> U
where Self: Sized,

Imperatively modify self with the given closure.
Source§

fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
where Self: Sized,

Conditionally modify self with the given closure.
Source§

fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
where Self: Sized,

Conditionally modify self with the given closure.
Source§

fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self, ) -> Self
where Self: Sized,

Conditionally unwrap and modify self with the given closure, if the given option is Some.
Source§

fn when_none<T>( self, option: &Option<T>, then: impl FnOnce(Self) -> Self, ) -> Self
where Self: Sized,

Conditionally unwrap and modify self with the given closure, if the given option is None.
Source§

impl<T> FocusTrapElement for T

Source§

fn focus_trap( self, id: impl Into<ElementId>, focus_handle: &FocusHandle, ) -> FocusTrapContainer<Self>
where Self: ParentElement + Styled + Element + 'static,

Enable focus trap for this element. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more