Skip to content

Commit

Permalink
Fix docs and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Sep 22, 2023
1 parent a13d5ff commit 4fc6996
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct ChildNode<'a, N: Node> {
/// * `cache` - A mutable reference to the [`Cache`].
/// * `tree` - A mutable reference to the [`Tree`](crate::Node::Tree).
/// * `store` - A mutable reference to the [`Store`](crate::Node::Store).
/// * `sublayout` - A mutable reference to the [`Sublayout`](crate::Node::SubLayout) context.
/// * `sublayout` - A mutable reference to the [`SubLayout`](crate::Node::SubLayout) context.
///
/// # Example
///
Expand Down
15 changes: 12 additions & 3 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@ pub trait Node: Sized {
type ChildIter<'t>: Iterator<Item = &'t Self>
where
Self: 't;

/// A type representing a key to store and retrieve values from the [`Cache`](crate::Cache).
type CacheKey;

/// A type representing a context which can be used to save/load state when computing [content size](crate::Node::content_size).
/// For example, a `TextContext` which could be used to measure (and cache) the size of text, which could
/// then be used to size an `Auto` layout node using content size.
type SubLayout<'a>;

/// Performs a layout calculation on the node (see [layout](crate::layout::layout)).
/// Performs layout on the given node returning its computed size.
///
/// The algorithm recurses down the tree, in depth-first order, and performs
/// layout on every node starting from the input `node`.
///
/// # Arguments
///
/// * `cache` - A mutable reference to the [`Cache`].
/// * `tree` - A mutable reference to the [`Tree`](crate::Node::Tree).
/// * `store` - A mutable reference to the [`Store`](crate::Node::Store).
/// * `sublayout` - A mutable reference to the [`SubLayout`](crate::Node::SubLayout) context.
///
fn layout<C: Cache<Node = Self>>(
&self,
cache: &mut C,
Expand Down

0 comments on commit 4fc6996

Please sign in to comment.