pub trait Renderer: Send + Sync {
// Required methods
fn validate(&self, request: &RenderRequest) -> Result<RendererValidation>;
fn render(&self, request: &RenderRequest) -> Result<RenderedDocument>;
// Provided method
fn render_cancellable(
&self,
request: &RenderRequest,
cancellation: &CancellationToken,
) -> Result<RenderedDocument> { ... }
}Expand description
Object-safe boundary implemented by native, future WASM, or alternate backends.
Required Methods§
Sourcefn validate(&self, request: &RenderRequest) -> Result<RendererValidation>
fn validate(&self, request: &RenderRequest) -> Result<RendererValidation>
Parse and validate without producing artifacts.
Sourcefn render(&self, request: &RenderRequest) -> Result<RenderedDocument>
fn render(&self, request: &RenderRequest) -> Result<RenderedDocument>
Validate, compose, and return requested artifacts in memory.
Provided Methods§
Sourcefn render_cancellable(
&self,
request: &RenderRequest,
cancellation: &CancellationToken,
) -> Result<RenderedDocument>
fn render_cancellable( &self, request: &RenderRequest, cancellation: &CancellationToken, ) -> Result<RenderedDocument>
Renders while checking a cooperative cancellation signal.
Implementations that do not override this method are cancellable before
and after their render call. NativeRenderer also checks between
inspection, composition, DOCX writing, and PDF rendering.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".