frust_scene/lib.rs
1//! Layer 3: vector scene / display list, renderer-agnostic scene builder.
2//!
3//! `Scene`/`SceneBuilder`/`Command` are the stable seam between widgets (layer
4//! 1+2) and the GPU backend (layer 4, `frust-render`). Only `kurbo`
5//! (geometry) and `peniko` (brushes/fonts) appear in this crate's public API —
6//! `vello`/`wgpu` types are forbidden here so the render backend can be swapped
7//! later.
8
9mod arc;
10mod builder;
11mod glyph;
12mod scene;
13mod shader;
14
15pub use arc::arc_path;
16pub use builder::SceneBuilder;
17pub use glyph::{FontHandle, Glyph, GlyphRun};
18pub use scene::{Command, CornerRadii, DashPattern, PathStyle, Scene};
19pub use shader::ShaderProgram;
20
21/// Compile-time assertion that [`Scene`] is [`Send`].
22///
23/// This tripwire is a refactor guard: any future field added to [`Scene`]
24/// that is `!Send` will fail this assertion with a helpful compiler message
25/// pointing to this site.
26///
27/// The assertion is necessary to keep the render-thread-split path viable —
28/// splitting render onto a dedicated thread requires the scene to move
29/// safely across thread boundaries.
30const _: () = {
31 /// Zero-cost static assertion that `T: Send`.
32 const fn assert_send<T: Send>() {}
33
34 const fn check_scene_is_send() {
35 assert_send::<Scene>();
36 }
37
38 // Invoke the assertion at compile time
39 let () = check_scene_is_send();
40};