Skip to main content

View

Trait View 

Source
pub trait View {
Show 29 methods // Required method fn body(&self) -> impl View + 'static; // Provided methods fn layout_style_ctx(&self, _rt: &Runtime, _el: ElementId) -> LayoutStyle { ... } fn accessibility(&self) -> Option<Accessible> { ... } fn arrange_override( &self, _rt: &Runtime, _el: ElementId, _rect: Rect, _ctx: &mut LayoutCtx<'_>, ) -> bool { ... } fn clip_self(&self) -> bool { ... } fn clip_radius(&self) -> f32 { ... } fn paint_opacity(&self) -> Option<f32> { ... } fn cache_layer(&self) -> bool { ... } fn paint_opacity_ctx(&self, _rt: &Runtime, _el: ElementId) -> Option<f32> { ... } fn paint_offset(&self) -> Vec2 { ... } fn paint_offset_ctx(&self, _rt: &Runtime, _el: ElementId) -> Vec2 { ... } fn paint_scale(&self) -> f32 { ... } fn paint_scale_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32 { ... } fn paint_rotation(&self) -> f32 { ... } fn paint_rotation_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32 { ... } fn foreground_filter(&self) -> Option<Filter> { ... } fn captures_pointer_ctx(&self, _rt: &Runtime, _el: ElementId) -> bool { ... } fn reuse_state(&self, _old: &Self) { ... } fn hit_testable(&self) -> bool { ... } fn test_id(&self) -> Option<String> { ... } fn focus_trap(&self) -> bool { ... } fn accepts_tab(&self) -> bool { ... } fn accepts_text_input(&self) -> bool { ... } fn paint_foreground(&self, _ctx: &mut PaintCtx<'_>) { ... } fn accepts_drop(&self, _payload: &DragPayload) -> bool { ... } fn on_drag_over(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>) { ... } fn on_drop(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>) { ... } fn on_drag_start(&self, _ctx: &mut EventCtx<'_>) { ... } fn on_drag_end(&self, _end: DragEnd, _ctx: &mut EventCtx<'_>) { ... }
}

Required Methods§

Source

fn body(&self) -> impl View + 'static

Provided Methods§

Source

fn layout_style_ctx(&self, _rt: &Runtime, _el: ElementId) -> LayoutStyle

Source

fn accessibility(&self) -> Option<Accessible>

Source

fn arrange_override( &self, _rt: &Runtime, _el: ElementId, _rect: Rect, _ctx: &mut LayoutCtx<'_>, ) -> bool

Source

fn clip_self(&self) -> bool

Source

fn clip_radius(&self) -> f32

Source

fn paint_opacity(&self) -> Option<f32>

Source

fn cache_layer(&self) -> bool

Allows the runtime to replay this element’s painted subtree from cache while its element revision and absolute paint context stay unchanged.

Cache hits skip paint_self and paint_foreground, so their side effects must not be required for later frames.

Source

fn paint_opacity_ctx(&self, _rt: &Runtime, _el: ElementId) -> Option<f32>

Source

fn paint_offset(&self) -> Vec2

Source

fn paint_offset_ctx(&self, _rt: &Runtime, _el: ElementId) -> Vec2

Source

fn paint_scale(&self) -> f32

Source

fn paint_scale_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32

Source

fn paint_rotation(&self) -> f32

Source

fn paint_rotation_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32

Source

fn foreground_filter(&self) -> Option<Filter>

Source

fn captures_pointer_ctx(&self, _rt: &Runtime, _el: ElementId) -> bool

Source

fn reuse_state(&self, _old: &Self)

Source

fn hit_testable(&self) -> bool

Source

fn test_id(&self) -> Option<String>

Source

fn focus_trap(&self) -> bool

Source

fn accepts_tab(&self) -> bool

Source

fn accepts_text_input(&self) -> bool

Whether this view edits text when focused.

Hosts use this to keep single-key accelerators (Delete, Backspace, letter keys) from stealing input while a text field or text area has focus. Command shortcuts such as Ctrl+S still fire.

Source

fn paint_foreground(&self, _ctx: &mut PaintCtx<'_>)

Source

fn accepts_drop(&self, _payload: &DragPayload) -> bool

Source

fn on_drag_over(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>)

Source

fn on_drop(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>)

Source

fn on_drag_start(&self, _ctx: &mut EventCtx<'_>)

Source

fn on_drag_end(&self, _end: DragEnd, _ctx: &mut EventCtx<'_>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl View for Animated

Source§

impl View for AnimatedSize

Source§

impl View for AnyView

Source§

impl View for AspectRatio

Source§

impl View for Avatar

Source§

impl View for BackdropBlur

Source§

impl View for BackdropFiltered

Source§

impl View for Badge

Source§

impl View for Button

Source§

impl View for Cached

Source§

impl View for Canvas

Source§

impl View for Checkbox

Source§

impl View for Chip

Source§

impl View for Clip

Source§

impl View for Column

Source§

impl View for CommandPalette

Source§

impl View for Container

Source§

impl View for ContextMenu

Source§

impl View for DateField

Source§

impl View for Deco

Source§

impl View for DevOverlay

Source§

impl View for Dialog

Source§

impl View for DismissableLayer

Source§

impl View for Divider

Source§

impl View for DockArea

Source§

impl View for DockFloatLayer

Source§

impl View for DockHeader

Source§

impl View for DockPanel

Source§

impl View for DockSlot

Source§

impl View for DockView

Source§

impl View for DockWindowHost

Source§

impl View for DockWindowRoot

Source§

impl View for Dockable

Source§

impl View for DragValue

Source§

impl View for Drawer

Source§

impl View for DropdownButton

Source§

impl View for EdgeGhost

Source§

impl View for EdgeSlab

Source§

impl View for EffectNode

Source§

impl View for Enter

Source§

impl View for ErrorBoundary

Source§

impl View for Field

Source§

impl View for Filtered

Source§

impl View for FloatingMenu

Source§

impl View for FocusRing

Source§

impl View for FocusScope

Source§

impl View for Fragment

Source§

impl View for Grid

Source§

impl View for Icon

Source§

impl View for Image

Source§

impl View for Kbd

Source§

impl View for LiveBackground

Source§

impl View for LiveOffset

Source§

impl View for LiveOpacity

Source§

impl View for Margined

Source§

impl View for Masonry

Source§

impl View for MenuBar

Source§

impl View for Modal

Source§

impl View for ModalScrim

Source§

impl View for MultiSelect

Source§

impl View for NumberField

Source§

impl View for Opacity

Source§

impl View for Panel

Source§

impl View for PickerFloat

Source§

impl View for Popper

Source§

impl View for Portal

Source§

impl View for Presence

Source§

impl View for ProgressBar

Source§

impl View for Pulse

Source§

impl View for RadioButton

Source§

impl View for RadioGroup

Source§

impl View for ResizeHandle

Source§

impl View for Responsive

Source§

impl View for RichText

Source§

impl View for Rotated

Source§

impl View for Row

Source§

impl View for Scaled

Source§

impl View for ScrollView

Source§

impl View for Scrub

Source§

impl View for Shake

Source§

impl View for Sheet

Source§

impl View for Skeleton

Source§

impl View for Slider

Source§

impl View for Slider1D

Source§

impl View for Spacer

Source§

impl View for Spinner

Source§

impl View for SplitPanel

Source§

impl View for Stack

Source§

impl View for States

Source§

impl View for SvPad

Source§

impl View for Switch

Source§

impl View for TabStrip

Source§

impl View for Text

Source§

impl View for TextArea

Source§

impl View for TextField

Source§

impl View for ToastStack

Source§

impl View for Tooltip

Source§

impl View for Translate

Source§

impl View for Unit

Source§

impl View for When

Source§

impl View for WindowControls

Source§

impl View for WithSize

Source§

impl View for Wrap

Source§

impl<R> View for Table<R>
where R: Clone + 'static,

Source§

impl<T> View for AsyncView<T>
where T: Clone + PartialEq + 'static,

Source§

impl<T> View for List<T>
where T: 'static,

Source§

impl<T> View for TreeView<T>
where T: Clone + 'static,

Source§

impl<T> View for VirtualList<T>
where T: 'static,

Source§

impl<V: View + 'static, T: Clone + 'static> View for Draggable<V, T>

Source§

impl<V: View + 'static, T: Clone + 'static> View for Droppable<V, T>