Skip to main content

WidgetPod

Struct WidgetPod 

Source
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

Source

pub fn new<W>(widget: W) -> Self
where W: Widget + 'static,

Source

pub const fn id(&self) -> WidgetId

Source

pub fn debug_name(&self) -> &'static str

Source

pub fn diagnostics_snapshot(&self) -> WidgetDiagnosticsSnapshot

Source

pub fn collect_diagnostics(&self, output: &mut Vec<WidgetDiagnosticsSnapshot>)

Source

pub const fn bounds(&self) -> Rect

Source

pub const fn measured_size(&self) -> Size

Source

pub fn set_bounds(&mut self, bounds: Rect)

Source

pub fn measure( &mut self, parent_ctx: &mut MeasureCtx, constraints: Constraints, ) -> Size

Source

pub fn intrinsic_size( &mut self, parent_ctx: &mut MeasureCtx, axis: Axis, available_cross: f32, ) -> IntrinsicSize

Source

pub fn arrange(&mut self, parent_ctx: &mut ArrangeCtx, bounds: Rect)

Source

pub fn paint(&self, parent_ctx: &mut PaintCtx)

Source

pub fn semantics(&self, parent_ctx: &mut SemanticsCtx)

Source

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.

Source

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§

Source§

impl Drop for WidgetPod

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.