mizchi/crater/layout/tree does not have a README file
pub struct CacheStats {
cache_hits : Int
cache_misses : Int
nodes_computed : Int
}pub struct ConstraintKey {
available_width : Double
available_height : Double?
sizing_mode : SizingMode
}impl Eq for ConstraintKeyfn ConstraintKey::new(available_width : Double, available_height : Double?, sizing_mode : SizingMode) -> ConstraintKeypub struct ConstraintSpace {
available_width : Double
available_height : Double?
sizing_mode : SizingMode
parent_width : Double
parent_height : Double?
viewport_width : Double
viewport_height : Double
}fn ConstraintSpace::new(available_width : Double, available_height : Double?, sizing_mode : SizingMode, parent_width : Double, parent_height : Double?, viewport_width? : Double, viewport_height? : Double) -> ConstraintSpacepub(all) enum DependencyKind {
Static
ParentWidth
ParentHeight
ParentBoth
Intrinsic
Viewport
}impl Eq for DependencyKindimpl Show for DependencyKindpub struct Document {
dom : DomTree
layout : LayoutTree
dom_to_layout : Map[Int, Int]
layout_to_dom : Map[Int, Int]
needs_layout : Bool
}pub(all) enum IntrinsicState {
Resolved(Double, Double)
Pending(Double, Double)
Error
}pub struct LayoutNode {
id : String
uid : Int
style : Style
children : Array[LayoutNode]
measure : MeasureFunc?
text : String?
dirty : Bool
children_dirty : Bool
cached_layout : LayoutCache?
dependencies : DependencyKind
computed_x : Double
computed_y : Double
computed_width : Double
computed_height : Double
has_new_layout : Bool
intrinsic_state : IntrinsicState?
on_dirty : (Int) -> Unit?
}fn LayoutNode::set_grid_auto_columns(self : LayoutNode, tracks : Array[TrackSizingFunction]) -> LayoutNodefn LayoutNode::set_grid_auto_rows(self : LayoutNode, tracks : Array[TrackSizingFunction]) -> LayoutNodefn LayoutNode::set_grid_column(self : LayoutNode, start : GridPlacement, end : GridPlacement) -> LayoutNodefn LayoutNode::set_grid_row(self : LayoutNode, start : GridPlacement, end : GridPlacement) -> LayoutNodefn LayoutNode::set_grid_template_columns(self : LayoutNode, tracks : Array[TrackSizingFunction]) -> LayoutNodefn LayoutNode::set_grid_template_rows(self : LayoutNode, tracks : Array[TrackSizingFunction]) -> LayoutNodepub struct LayoutTree {
root : LayoutNode
parent_map : Map[Int, Int]
node_map : Map[Int, LayoutNode]
viewport_width : Double
viewport_height : Double
resources : ResourceRegistry
}fn LayoutTree::add_node(self : LayoutTree, parent_id : String, index : Int, node : LayoutNode) -> Boolfn LayoutTree::attach_resource(self : LayoutTree, rid : ResourceId, node_uid : Int, placeholder_width? : Double, placeholder_height? : Double) -> Unitfn LayoutTree::batch_update_styles(self : LayoutTree, updates : Array[(String, CascadedValues)]) -> Intfn LayoutTree::from_html_document(doc : Document, viewport_width : Double, viewport_height : Double) -> LayoutTreefn LayoutTree::from_node(node : Node, viewport_width : Double, viewport_height : Double) -> LayoutTreefn LayoutTree::new(root : LayoutNode, viewport_width : Double, viewport_height : Double) -> LayoutTreefn LayoutTree::register_pending_images_with_src(self : LayoutTree, uid_to_src : Map[Int, String]) -> Map[String, ResourceId]fn LayoutTree::register_resource(self : LayoutTree, node_uid : Int, placeholder_width? : Double, placeholder_height? : Double) -> ResourceIdfn LayoutTree::resolve_resource(self : LayoutTree, rid : ResourceId, width : Double, height : Double) -> Unitfn LayoutTree::update_node_style(self : LayoutTree, node_id : String, values : CascadedValues) -> Boolpub(all) type ResourceId Intimpl Eq for ResourceIdimpl Hash for ResourceIdimpl Show for ResourceId#deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
fn ResourceId::inner(self : ResourceId) -> Intpub(all) enum TreeChange {
AddNode(String, Int, LayoutNode)
RemoveNode(String)
MoveNode(String, String, Int)
UpdateStyle(String)
ReplaceChildren(String, Array[LayoutNode])
}let default_placeholder_width : Doublelet error_placeholder_width : DoubleInstall
Download zipCSS Layout Engine that implements Box/Flex/Grid