Skip to content

Commit e4325c6

Browse files
committed
Introduced a builder pattern interface (#275)
1 parent a4b481f commit e4325c6

File tree

6 files changed

+395
-0
lines changed

6 files changed

+395
-0
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ default = [
4343
"calc",
4444
"content_size",
4545
"detailed_layout_info",
46+
"builder"
4647
]
4748
#! ## Feature Flags
4849
#!
@@ -62,6 +63,8 @@ content_size = []
6263
detailed_layout_info = []
6364
## Use strict provenance APIs for pointer manipulation. Using this feature requires Rust 1.84 or higher.
6465
strict_provenance = []
66+
## Expose a builder pattern interface to construct layout tree
67+
builder = ["alloc"]
6568

6669
#! ### Taffy Tree
6770

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ pub use crate::compute::{
109109
};
110110
#[doc(inline)]
111111
pub use crate::style::Style;
112+
#[cfg(feature = "builder")]
113+
#[doc(inline)]
114+
pub use crate::style::StyleBuilder;
112115
#[doc(inline)]
113116
pub use crate::tree::traits::*;
114117
#[cfg(feature = "taffy_tree")]

src/prelude.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ pub use crate::style_helpers::{
2828

2929
#[cfg(feature = "taffy_tree")]
3030
pub use crate::TaffyTree;
31+
32+
#[cfg(feature = "builder")]
33+
pub use crate::style::{NodeIdRef, StyleBuilder};

0 commit comments

Comments
 (0)