Module lay_rs::prelude::taffy

source ·

Modules§

  • Low-level access to the layout algorithms themselves. For a higher-level API, see the TaffyTree struct.
  • Geometric primitives useful for layout
  • Commonly used types
  • A typed representation of CSS style properties in Rust. Used as input to layout computation.
  • Helper functions which it make it easier to create instances of types in the style and geometry modules.
  • Contains both a high-level interface to Taffy using a ready-made node tree, and a set of traits for defining custom node trees.
  • Helpful misc. utilities such as a function to debug print a tree

Structs§

  • A cache for caching the results of a sizing a Grid Item or Flexbox Item
  • A set of margins that are available for collapsing with for block layout’s margin collapsing
  • The final result of a layout algorithm for a single node.
  • A struct containing the inputs constraints/hints for laying out a node, which are passed in by the parent
  • A struct containing the result of laying a single node, which is returned up to the parent node
  • An abstract “line”. Represents any type that has a start and an end
  • Generic struct which holds a “min” value and a “max” value
  • A type representing the id of a single node in a tree of nodes
  • A 2-dimensional coordinate.
  • An axis-aligned UI rectangle
  • The width and height of a Rect
  • A typed representation of the CSS style information for a single node.
  • An entire tree of UI nodes. The entry point to Taffy’s high-level API.

Enums§

Traits§

  • Trait to create constant percent values from plain numbers
  • Trait to create absolute length values from plain numbers
  • Trait to create constant percent values from plain numbers
  • Any type that implements LayoutPartialTree can be laid out using Taffy’s algorithms
  • A trait to conveniently calculate minimums and maximums when some data may not be defined
  • Trait to encapsulate behaviour where we need to resolve from a potentially context-dependent size or dimension into a context-independent size or dimension.
  • Trait used by the print_tree method which prints a debug representation
  • Trait to encapsulate behaviour where we need to resolve from a potentially context-dependent size or dimension into a context-independent size or dimension.
  • Trait used by the round_layout method which takes a tree of unrounded float-valued layouts and performs rounding to snap the values to the pixel grid.
  • Trait to abstract over auto values
  • Trait to create fit-content(…) values from plain numbers
  • Trait to abstract over grid line values
  • Trait to abstract over grid span values
  • Trait to abstract over max_content values
  • Trait to abstract over min_content values
  • Trait to abstract over zero values
  • This trait is Taffy’s abstraction for downward tree traversal. However, this trait does not require access to any node’s other than a single container node’s immediate children unless you also intend to implement TraverseTree.
  • A marker trait which extends TraversePartialTree with the additional guarantee that the child/children methods can be used to recurse infinitely down the tree. Is required by the RoundTree and the PrintTree traits.

Functions§

  • Returns the auto value for that type
  • Computes the layout of LayoutPartialTree according to the block layout algorithm
  • Attempts to find a cached layout for the specified node and layout inputs.
  • Computes the layout of LayoutPartialTree according to the flexbox algorithm
  • Grid layout algorithm This consists of a few phases:
  • Creates a layout for this node and its children, recursively. Each hidden node has zero size and is placed at the origin
  • Compute the size of a leaf node (node with no children)
  • Compute layout for the root node in the tree
  • Returns a grid template containing count evenly sized tracks
  • Returns a value of the inferred type which represent a fit-content(…) value with the given argument.
  • Shorthand for minmax(0, Nfr). Probably what you want if you want exactly evenly sized tracks.
  • Create a Fraction track sizing function (fr in CSS)
  • Returns a value of the inferred type which represent an absolute length
  • Specifies a grid line to place a grid item between in CSS Grid Line coordinates:
  • Returns the auto value for that type
  • Returns the auto value for that type
  • Returns a MinMax with min value of min and max value of max
  • Returns a value of the inferred type which represent a percentage
  • Prints a debug representation of the computed layout for a tree of nodes, starting with the passed root node.
  • Returns an auto-repeated track definition
  • Rounds the calculated layout to exact pixel values
  • Returns a GridPlacement::Span
  • Returns the zero value for that type

Type Aliases§

  • Used to control how the specified nodes is aligned. Overrides the parent Node’s AlignItems property. For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
  • A grid line placement specification. Used for grid-[row/column]-[start/end]. Named tracks are not implemented.
  • Sets the distribution of space between and around content items For Flexbox it controls alignment in the main axis For Grid it controls alignment in the inline axis
  • Used to control how child nodes are aligned. Does not apply to Flexbox, and will be ignored if specified on a flex container For Grid it controls alignment in the inline axis
  • Used to control how the specified nodes is aligned. Overrides the parent Node’s JustifyItems property. Does not apply to Flexbox, and will be ignored if specified on a flex child For Grid it controls alignment in the inline axis
  • The sizing function for a grid track (row/column) (either auto-track or template track) May either be a MinMax variant which specifies separate values for the min-/max- track sizing functions or a scalar value which applies to both track sizing functions.
  • The error Taffy generates on invalid operations