#[non_exhaustive]pub enum ViewKind {
Show 13 variants
Box,
Row,
Column,
Stack,
ZStack,
OverlayHost,
ScrollV {
on_scroll: Option<ScrollCallback>,
set_viewport_height: Option<Rc<dyn Fn(f32)>>,
set_content_height: Option<Rc<dyn Fn(f32)>>,
get_scroll_offset: Option<Rc<dyn Fn() -> f32>>,
set_scroll_offset: Option<Rc<dyn Fn(f32)>>,
show_scrollbar: bool,
tick_scroll: Option<Rc<dyn Fn()>>,
},
ScrollXY {
on_scroll: Option<ScrollCallback>,
set_viewport_width: Option<Rc<dyn Fn(f32)>>,
set_viewport_height: Option<Rc<dyn Fn(f32)>>,
set_content_width: Option<Rc<dyn Fn(f32)>>,
set_content_height: Option<Rc<dyn Fn(f32)>>,
get_scroll_offset_xy: Option<Rc<dyn Fn() -> (f32, f32)>>,
set_scroll_offset_xy: Option<Rc<dyn Fn(f32, f32)>>,
show_scrollbar: bool,
tick_scroll: Option<Rc<dyn Fn()>>,
},
Text {
text: String,
color: Color,
font_size: f32,
soft_wrap: bool,
max_lines: Option<usize>,
overflow: TextOverflow,
font_family: Option<&'static str>,
annotations: Option<Arc<[TextSpan]>>,
},
Image {
handle: ImageHandle,
tint: Color,
fit: ImageFit,
},
SubcomposeLayout {
content: Arc<dyn Fn(&SubcomposeScope) -> Vec<(u64, View)>>,
},
Expander {
expanded: bool,
on_toggle: Option<Callback>,
},
TreeRow {
depth: usize,
has_children: bool,
is_expanded: bool,
is_selected: bool,
on_toggle: Option<Callback>,
on_select: Option<Callback>,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Box
Row
Column
Stack
ZStack
OverlayHost
ScrollV
Fields
§
on_scroll: Option<ScrollCallback>ScrollXY
Fields
§
on_scroll: Option<ScrollCallback>Text
Fields
§
overflow: TextOverflowImage
SubcomposeLayout
A layout whose children are produced by calling content with the
current SubcomposeScope. The closure is invoked during reconciliation
and returns a list of (slot_id, view) pairs. Each slot id is a stable
identity used to reconcile the returned view across frames. This is
the building block for BoxWithConstraints and other
constraints-driven layouts.
Note: any Modifier::key set on a returned view is overwritten by its
slot id so the slot’s identity is stable across frames.
Expander
A collapsible section with a clickable header. First child is the header content; remaining children shown only when expanded.
TreeRow
A single row in a tree view with indentation and expand/select support. First child is rendered as the row label/content.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ViewKind
impl !Send for ViewKind
impl !Sync for ViewKind
impl !UnwindSafe for ViewKind
impl Freeze for ViewKind
impl Unpin for ViewKind
impl UnsafeUnpin for ViewKind
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