Struct InspectorLayout

Source
pub struct InspectorLayout<'a> { /* private fields */ }
Expand description

Immutable measured layout. No heap storage, model/controller or hidden reset state. Rebuild after any model/copy/theme/bounds change; Ui::begin clears old submissions, and Ui::cancel cancels capture when the tool closes/resets.

Implementations§

Source§

impl<'a> InspectorLayout<'a>

Source

pub fn new( bounds: Rect, fields: &'a [InspectorField<'a>], theme: UiTheme, ) -> Result<InspectorLayout<'a>, UiError>

Validate bounded source and measure complete rows. Empty fields are valid. Duplicate IDs return DuplicateId; source limits return Capacity; invalid numeric specs, blank essential copy and impossible geometry return InvalidLayout.

Source

pub fn bounds(&self) -> Rect

Source

pub fn field_rect(&self, id: u64) -> Option<Rect>

Complete row including its label/value/status/control rows.

Source

pub fn control_rect(&self, id: u64) -> Option<Rect>

Exact rectangle submitted to the existing button painter/hit registry.

Source

pub fn finish<E>( &self, ui: &mut Ui, enabled: bool, validate: impl FnOnce(ValueChange) -> Result<(), E>, ) -> Result<InspectorOutcome<E>, UiError>

Submit atomically, finish built-in input, then run a pure validator once for an actual change. All UI submission errors occur before validation.

Source

pub fn finish_player<E>( &self, ui: &mut Ui, player: &mut PlayerInput, enabled: bool, validate: impl FnOnce(ValueChange) -> Result<(), E>, ) -> Result<InspectorOutcome<E>, UiError>

Same transaction/result contract, using existing remapped confirm and selected-pad handling. Unrelated gameplay edges remain caller/tick-owned.

Trait Implementations§

Source§

impl<'a> Debug for InspectorLayout<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for InspectorLayout<'a>

§

impl<'a> RefUnwindSafe for InspectorLayout<'a>

§

impl<'a> Send for InspectorLayout<'a>

§

impl<'a> Sync for InspectorLayout<'a>

§

impl<'a> Unpin for InspectorLayout<'a>

§

impl<'a> UnwindSafe for InspectorLayout<'a>

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.