pub struct Renderer { /* private fields */ }Expand description
Immutable renderer for this release’s compatibility revision.
A renderer holds no per-render state: it is cheap to construct, Clone,
Send and Sync, and one instance can serve concurrent renders.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn render(
&self,
scene: &SceneDocument,
request: &RenderRequest,
) -> Result<RenderOutcome, RenderError>
pub fn render( &self, scene: &SceneDocument, request: &RenderRequest, ) -> Result<RenderOutcome, RenderError>
Renders one admitted scene into the request’s selected output format.
§Errors
Returns a RenderError when no complete artifact can be produced.
Its category says why:
Input: the scene has no finite bounds (scene.unbounded-geometry).Capability: a font the scene needs is not in this build (render.font-unavailable; see the crate’scjkfeature).ResourceLimit: the render crosses one of the request’sResourceLimits(aresource.*code), or a required allocation failed (resource.memory-unavailable).NoMeaningfulArtifact: a PDF raster fallback was forbidden by the request or could not be isolated (pdf.raster-fallback-*).Encoding: writing the artifact failed (anencode.*code).Internal: a renderer invariant failed (render.internal-failure).
The error carries the complete report accumulated before the failure.
Sourcepub fn render_frame(
&self,
frame: FrameRef<'_>,
request: &FrameRenderRequest,
) -> Result<RenderOutcome, RenderError>
pub fn render_frame( &self, frame: FrameRef<'_>, request: &FrameRenderRequest, ) -> Result<RenderOutcome, RenderError>
Renders one discovered frame using reference frame-export semantics.
§Errors
Returns a RenderError in the same categories as
render. A frame whose viewport falls outside
max_coordinate_magnitude fails with
resource.coordinate-range-exceeded.
Sourcepub fn render_frames<'scene, 'request>(
&self,
scene: &'scene SceneDocument,
frames: impl IntoIterator<Item = FrameRef<'scene>>,
request: &'request FrameRenderRequest,
) -> Result<FrameRenderCursor<'scene, 'request>, FrameBatchError>
pub fn render_frames<'scene, 'request>( &self, scene: &'scene SceneDocument, frames: impl IntoIterator<Item = FrameRef<'scene>>, request: &'request FrameRenderRequest, ) -> Result<FrameRenderCursor<'scene, 'request>, FrameBatchError>
Starts lazy source-ordered rendering for selected frames.
§Errors
Returns a FrameBatchError before rendering
anything when a selected frame belongs to another scene document
(frame-batch.foreign-target), when the same frame is selected twice
(frame-batch.duplicate-target), or when the preparation the frames
share cannot be completed (frame-batch.shared-preparation-failed).
Each frame’s own render failure is reported by its
FrameRenderEntry instead.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.