Skip to main content

Element

Struct Element 

Source
pub struct Element { /* private fields */ }

Implementations§

Source§

impl Element

Source

pub fn new( render: impl FnOnce(ElementRenderCx<'_, '_, '_>) -> UiElement + 'static, ) -> Self

Source

pub fn with_key( key: ElementKey, render: impl FnOnce(ElementRenderCx<'_, '_, '_>) -> UiElement + 'static, ) -> Self

Source

pub fn child(self, child: impl Into<Element>) -> Self

Source

pub fn content(self, content: impl IntoElementContent) -> Self

Source

pub fn children( self, children: impl IntoIterator<Item = impl Into<Element>>, ) -> Self

Source

pub fn key(self, key: impl AsRef<str>) -> Self

Source

pub fn interaction(self, interaction: InteractionRole) -> Self

Source

pub fn semantics(self, semantics: Semantics) -> Self

Source

pub fn window_drag_region(self) -> Self

Marks this element as a native window drag region.

Interactive descendants are excluded automatically by hit testing.

Source

pub fn phase(self, phase: RenderPhase) -> Self

Source

pub fn animation(self, binding: AnimationBinding) -> Self

Source

pub fn animation_target(self, property: AnimProperty, active: bool) -> Self

Source

pub fn paint_bounds(self, rect: UiRect) -> Self

Source

pub fn shadow(self, style: ShadowStyle) -> Self

Applies one shadow to the composited element and subtree. Ancestor clips still apply.

Source

pub fn focus_scope(self) -> Self

Source

pub fn defer_children_compile(self) -> Self

Source§

impl Element

Source

pub fn on_click_handler(self, handler: UiEventHandler) -> Self

Source

pub fn on_click_capture_handler(self, handler: UiEventHandler) -> Self

Source

pub fn event_policy(self, policy: EventPolicy) -> Self

Source

pub fn on_click<F, Arguments>(self, handler: F) -> Self
where F: IntoClickHandler<Arguments>,

Source

pub fn on_click_event<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_click_async<F, Fut>(self, handler: F) -> Self
where F: Fn(UiAsyncContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source

pub fn on_click_capture<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_event_handler( self, kind: UiEventKind, capture: bool, handler: UiInputEventHandler, ) -> Self

Source

pub fn on_event<F>(self, kind: UiEventKind, handler: F) -> Self
where F: Fn(&mut UiEventContext, &UiEventPayload) + Send + Sync + 'static,

Source

pub fn on_event_capture<F>(self, kind: UiEventKind, handler: F) -> Self
where F: Fn(&mut UiEventContext, &UiEventPayload) + Send + Sync + 'static,

Source

pub fn on_pointer_down<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, PointerData) + Send + Sync + 'static,

Source

pub fn on_pointer_move<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, PointerData) + Send + Sync + 'static,

Source

pub fn on_pointer_up<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, PointerData) + Send + Sync + 'static,

Source

pub fn on_wheel<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, WheelDelta) + Send + Sync + 'static,

Source

pub fn on_key_down<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, &KeyboardEvent) + Send + Sync + 'static,

Source

pub fn on_key_up<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, &KeyboardEvent) + Send + Sync + 'static,

Source

pub fn on_input<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, &str) + Send + Sync + 'static,

Source

pub fn on_composition_start<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_composition_update<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, &str, Option<Range<usize>>) + Send + Sync + 'static,

Source

pub fn on_composition_end<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_focus<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_blur<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_change<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext, Option<&str>) + Send + Sync + 'static,

Trait Implementations§

Source§

impl DeclarativeView for Element

Source§

fn compile( self, scope: &UiScope, context: &UiRenderContext<'_>, component_id: ComponentId, force_components: bool, ) -> UiElement

Source§

impl IntoElementContent for Element

Source§

fn append_to(self, children: &mut Vec<Element>)

Auto Trait Implementations§

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 = !

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.