pub struct WidgetPod { /* private fields */ }Expand description
Standard retained-widget adapter used by the SUI runtime.
WidgetPod gives a Widget stable identity, cached layout state, event
routing participation, and scene/semantics cooperation. It is the default
local retained model, but a widget’s own internals may still use custom
state, virtualization, worker threads, or remote systems before rejoining
SUI through widget contexts and scene output.
Implementations§
Source§impl WidgetPod
impl WidgetPod
pub fn new<W>(widget: W) -> WidgetPodwhere
W: Widget + 'static,
pub const fn id(&self) -> WidgetId
pub fn debug_name(&self) -> &'static str
pub fn diagnostics_snapshot(&self) -> WidgetDiagnosticsSnapshot
pub fn collect_diagnostics(&self, output: &mut Vec<WidgetDiagnosticsSnapshot>)
pub const fn bounds(&self) -> Rect
pub const fn measured_size(&self) -> Size
pub fn set_bounds(&mut self, bounds: Rect)
pub fn measure( &mut self, parent_ctx: &mut MeasureCtx, constraints: Constraints, ) -> Size
pub fn intrinsic_size( &mut self, parent_ctx: &mut MeasureCtx, axis: Axis, available_cross: f32, ) -> IntrinsicSize
pub fn arrange(&mut self, parent_ctx: &mut ArrangeCtx, bounds: Rect)
pub fn paint(&self, parent_ctx: &mut PaintCtx)
pub fn semantics(&self, parent_ctx: &mut SemanticsCtx)
Sourcepub fn accepts_focus(&self) -> bool
pub fn accepts_focus(&self) -> bool
Return whether this retained widget is a focus target.
Adaptive containers use this while selecting a restoration fallback for a subtree that has just become visible again.
Sourcepub fn visit_children(&self, visitor: &mut dyn WidgetPodVisitor)
pub fn visit_children(&self, visitor: &mut dyn WidgetPodVisitor)
Visit this pod’s direct children. Public so container widgets can walk their own subtree (e.g. to derive a focus-within visual by comparing descendant ids against the focused widget id — sui has no focus-within event, and any focus change repaints every window, so polling at paint time stays correct).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WidgetPod
impl !Send for WidgetPod
impl !Sync for WidgetPod
impl !UnwindSafe for WidgetPod
impl Freeze for WidgetPod
impl Unpin for WidgetPod
impl UnsafeUnpin for WidgetPod
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.