pub enum ViewKind {
Show 19 variants
Surface,
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,
},
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,
},
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]>>,
},
Button {
on_click: Option<Callback>,
},
TextField {
state_key: ViewId,
hint: String,
multiline: bool,
on_change: Option<Rc<dyn Fn(String)>>,
on_submit: Option<Rc<dyn Fn(String)>>,
focus_tracker: Option<Rc<Cell<bool>>>,
value: String,
},
Slider {
value: f32,
min: f32,
max: f32,
step: Option<f32>,
on_change: Option<CallbackF32>,
},
RangeSlider {
start: f32,
end: f32,
min: f32,
max: f32,
step: Option<f32>,
on_change: Option<CallbackRange>,
},
ProgressBar {
value: f32,
min: f32,
max: f32,
circular: bool,
},
Image {
handle: ImageHandle,
tint: Color,
fit: ImageFit,
},
Ellipse {
rect: Rect,
color: Color,
},
EllipseBorder {
rect: Rect,
color: Color,
width: f32,
},
SubcomposeLayout {
content: Arc<dyn Fn(&SubcomposeScope) -> Vec<(u64, View)>>,
},
}Variants§
Surface
Box
Row
Column
Stack
ZStack
OverlayHost
ScrollV
Fields
§
on_scroll: Option<ScrollCallback>ScrollXY
Fields
§
on_scroll: Option<ScrollCallback>Text
Fields
§
overflow: TextOverflowButton
TextField
Fields
Slider
RangeSlider
ProgressBar
Image
Ellipse
EllipseBorder
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.
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