Skip to main content

LayoutDebugger

Struct LayoutDebugger 

Source
pub struct LayoutDebugger { /* private fields */ }
Expand description

Layout constraint debugger.

Collects layout solve records for introspection. Thread-safe via internal synchronization; can be shared across the application.

Supports optional telemetry hooks for external observability (bd-32my.5).

Implementations§

Source§

impl LayoutDebugger

Source

pub fn new() -> Arc<Self>

Create a new debugger wrapped in Arc (disabled by default).

Source

pub fn set_telemetry_hooks(&self, hooks: LayoutTelemetryHooks)

Attach telemetry hooks for external observability.

Source

pub fn clear_telemetry_hooks(&self)

Remove telemetry hooks.

Source

pub fn enabled(&self) -> bool

Check if debugging is enabled.

Source

pub fn set_enabled(&self, enabled: bool)

Enable or disable debugging.

Source

pub fn toggle(&self) -> bool

Toggle debugging on/off.

Source

pub fn clear(&self)

Clear all recorded data.

Source

pub fn record(&self, record: LayoutRecord)

Record a flex layout solve.

Also fires telemetry hooks if attached:

  • on_layout_solve for every recorded layout
  • on_overflow if overflow detected
  • on_underflow if underflow detected
Source

pub fn record_grid(&self, record: GridLayoutRecord)

Record a grid layout solve.

Also fires telemetry hooks if attached.

Source

pub fn snapshot(&self) -> Vec<LayoutRecord>

Get a snapshot of all flex layout records.

Source

pub fn snapshot_grids(&self) -> Vec<GridLayoutRecord>

Get a snapshot of all grid layout records.

Source

pub fn overflows(&self) -> Vec<LayoutRecord>

Get records with overflow conditions.

Source

pub fn underflows(&self) -> Vec<LayoutRecord>

Get records with underflow conditions.

Source

pub fn report(&self) -> String

Generate a summary report of all recorded layouts.

Source

pub fn export_dot(&self) -> String

Export to Graphviz DOT format for visualization.

Each layout becomes a node, with edges representing parent-child relationships (if parent_index is set).

Trait Implementations§

Source§

impl Debug for LayoutDebugger

Source§

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

Formats the value using the given formatter. 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.