1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Facade for the builderx DSL.
//! Re-exports macros, core traits, and toolkit adapters via feature flags so
//! downstream crates can `use builderx::bx` without wiring adapters manually.
//!
//! # Examples
//! Build a tree using the default adapter (no UI toolkit required):
//! ```rust
//! use builderx::{bx, AttachChild, AttachChildren};
//!
//! #[derive(Default, Debug, PartialEq)]
//! struct Stub(Vec<&'static str>);
//!
//! impl AttachChild<&'static str> for Stub {
//! fn attach_child(mut self, child: &'static str) -> Self {
//! self.0.push(child);
//! self
//! }
//! }
//!
//! impl AttachChildren<&'static str> for Stub {
//! fn attach_children<I>(mut self, children: I) -> Self
//! where
//! I: IntoIterator<Item = &'static str>,
//! {
//! self.0.extend(children);
//! self
//! }
//! }
//!
//! let built = bx! { Stub::default() { "a", ..["b", "c"] } };
//! assert_eq!(built.0, ["a", "b", "c"]);
//! ```
/// Entry macro for the builder-pattern UI DSL.
pub use bx;
pub use ;
/// Default adapter chosen by the `gpui` feature; otherwise aliases the core default.
pub type DefaultAdapter = GpuiAdapter;
pub use DefaultAdapter;
/// Re-export gpui adapter when the feature is present.
pub use GpuiAdapter;