pub trait LayoutGridContainer: LayoutPartialTree {
type GridContainerStyle<'a>: GridContainerStyle<CustomIdent = Self::CustomIdent>
where Self: 'a;
type GridItemStyle<'a>: GridItemStyle<CustomIdent = Self::CustomIdent>
where Self: 'a;
// Required methods
fn get_grid_container_style(
&self,
node_id: NodeId,
) -> Self::GridContainerStyle<'_>;
fn get_grid_child_style(
&self,
child_node_id: NodeId,
) -> Self::GridItemStyle<'_>;
// Provided method
fn set_detailed_grid_info(
&mut self,
_node_id: NodeId,
_detailed_grid_info: DetailedGridInfo,
) { ... }
}
Expand description
Extends LayoutPartialTree
with getters for the styles required for CSS Grid layout
Required Associated Types§
Sourcetype GridContainerStyle<'a>: GridContainerStyle<CustomIdent = Self::CustomIdent>
where
Self: 'a
type GridContainerStyle<'a>: GridContainerStyle<CustomIdent = Self::CustomIdent> where Self: 'a
The style type representing the CSS Grid container’s styles
Sourcetype GridItemStyle<'a>: GridItemStyle<CustomIdent = Self::CustomIdent>
where
Self: 'a
type GridItemStyle<'a>: GridItemStyle<CustomIdent = Self::CustomIdent> where Self: 'a
The style type representing each CSS Grid item’s styles
Required Methods§
Sourcefn get_grid_container_style(
&self,
node_id: NodeId,
) -> Self::GridContainerStyle<'_>
fn get_grid_container_style( &self, node_id: NodeId, ) -> Self::GridContainerStyle<'_>
Get the container’s styles
Sourcefn get_grid_child_style(&self, child_node_id: NodeId) -> Self::GridItemStyle<'_>
fn get_grid_child_style(&self, child_node_id: NodeId) -> Self::GridItemStyle<'_>
Get the child’s styles
Provided Methods§
Sourcefn set_detailed_grid_info(
&mut self,
_node_id: NodeId,
_detailed_grid_info: DetailedGridInfo,
)
fn set_detailed_grid_info( &mut self, _node_id: NodeId, _detailed_grid_info: DetailedGridInfo, )
Set the node’s detailed grid information
Implementing this method is optional. Doing so allows you to access details about the the grid such as the computed size of each grid track and the computed placement of each grid item.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.