pub trait DeferredContent: Send + Sync {
// Required method
fn resolve(&self, context: &DrawContext) -> Result<Node, ValidationError>;
// Provided method
fn baseline(&self, _context: &DrawContext) -> Option<f64> { ... }
}Expand description
Content that expands into ordinary nodes at the current drawing time.
Deferred content is not a leaf: it owns no bounds or commands. Measuring and compiling resolve it first, so the outer placement and inherited scene time apply to the resolved subtree.
Required Methods§
Sourcefn resolve(&self, context: &DrawContext) -> Result<Node, ValidationError>
fn resolve(&self, context: &DrawContext) -> Result<Node, ValidationError>
Resolves this content to an ordinary node at the drawing time in context.
Provided Methods§
Sourcefn baseline(&self, _context: &DrawContext) -> Option<f64>
fn baseline(&self, _context: &DrawContext) -> Option<f64>
Real horizontal text baseline of the resolved node in local coordinates.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".