pub struct NativeState {
pub kind: WidgetKind,
pub props: Vec<Prop>,
pub frame: Rect,
pub parent: Option<NodeId>,
pub children: Vec<NodeId>,
pub focused: bool,
pub scroll_offset: Option<Point>,
pub viewport_insets: Option<Insets>,
pub selection: Option<Range<usize>>,
}Expand description
What a native widget actually shows, read back from the platform. Tests compare this with the core’s state to catch backend desyncs.
Fields§
§kind: WidgetKind§props: Vec<Prop>§frame: Rect§parent: Option<NodeId>§children: Vec<NodeId>§focused: boolHas keyboard focus (for text fields: is being edited).
scroll_offset: Option<Point>ScrollViews, Lists, Tables and TextAreas only: the current
scroll offset (a text area’s, in its own scroll view).
viewport_insets: Option<Insets>ScrollViews only: where the viewport is in the frame, inside the
room scroll bars that aren’t overlaid take (UiEvent::ViewportInsets).
selection: Option<Range<usize>>A focused text field’s or text area’s selection, in characters (an
empty one is the caret); None for anything else.
Trait Implementations§
Source§impl Clone for NativeState
impl Clone for NativeState
Source§impl Debug for NativeState
impl Debug for NativeState
Source§impl PartialEq for NativeState
impl PartialEq for NativeState
impl StructuralPartialEq for NativeState
Auto Trait Implementations§
impl !RefUnwindSafe for NativeState
impl !Send for NativeState
impl !Sync for NativeState
impl !UnwindSafe for NativeState
impl Forget for NativeState
impl Freeze for NativeState
impl Move for NativeState
impl Unpin for NativeState
impl UnsafeUnpin for NativeStatewhere
&'static str: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Prop>: UnsafeUnpin,
PhantomData<NodeId>: UnsafeUnpin,
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