Skip to main content

LayoutData

Trait LayoutData 

Source
pub trait LayoutData: Any + Debug {
    // Required methods
    fn same_as(&self, other: &(dyn LayoutData + 'static)) -> bool;
    fn as_any(&self) -> &(dyn Any + 'static);
}
Expand description

Data a child’s modifier gives one kind of parent layout, which that layout’s measure policy reads by its type: a grid cell, or the data of an app’s own layout. Compose’s ParentDataModifierNode data. Every 'static type with Debug and PartialEq is layout data.

Required Methods§

Source

fn same_as(&self, other: &(dyn LayoutData + 'static)) -> bool

Whether other holds the same data, so a parent can keep its last measure.

Source

fn as_any(&self) -> &(dyn Any + 'static)

The data as Any, to read it by its type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> LayoutData for T
where T: Any + Debug + PartialEq,