Skip to main content

NullDevice

Struct NullDevice 

Source
pub struct NullDevice { /* private fields */ }
Expand description

A null rendering device that discards all output.

Implementations§

Source§

impl NullDevice

Source

pub fn new(width: u32, height: u32) -> Self

Trait Implementations§

Source§

impl OutputDevice for NullDevice

Source§

fn fill_path(&mut self, _path: &PsPath, _params: &FillParams)

Fill a path with the given color.
Source§

fn stroke_path(&mut self, _path: &PsPath, _params: &StrokeParams)

Stroke a path with the given parameters.
Source§

fn clip_path(&mut self, _path: &PsPath, _params: &ClipParams)

Intersect the current clip region with the given path.
Source§

fn init_clip(&mut self)

Reset clipping to the full page.
Source§

fn erase_page(&mut self)

Erase the page (fill with white).
Source§

fn show_page(&mut self, _output_path: &str) -> Result<(), String>

Output the current page (e.g., save PNG) and return Ok/Err.
Source§

fn draw_image(&mut self, _sample_data: &[u8], _params: &ImageParams)

Draw an image from raw sample data.
Source§

fn page_size(&self) -> (u32, u32)

Page dimensions in device pixels.
Source§

fn paint_axial_shading(&mut self, _params: &AxialShadingParams)

Paint an axial (linear) gradient shading.
Source§

fn paint_radial_shading(&mut self, _params: &RadialShadingParams)

Paint a radial gradient shading.
Source§

fn paint_mesh_shading(&mut self, _params: &MeshShadingParams)

Paint a Gouraud-shaded triangle mesh.
Source§

fn paint_patch_shading(&mut self, _params: &PatchShadingParams)

Paint a Coons/tensor-product patch mesh.
Source§

fn paint_pattern_fill(&mut self, _params: &PatternFillParams)

Paint a tiled pattern fill.
Source§

fn set_trim_box(&mut self, _llx: f64, _lly: f64, _urx: f64, _ury: f64)

Set the trim box for the next page (PDF points, lower-left origin). Only meaningful for PDF output; other devices ignore this.
Source§

fn replay_and_show( &mut self, list: DisplayList, output_path: &str, ) -> Result<(), String>

Replay a display list and write output in one step.
Source§

fn finish(&mut self) -> Result<(), String>

Wait for any pending background render to complete.
Source§

fn finish_with_context(&mut self, _ctx: &Context) -> Result<(), String>

Called after interpretation finishes, with access to the interpreter context.
Source§

fn as_any(&self) -> &dyn Any

Downcast to a concrete type. Override in implementations that need to be accessed after rendering (e.g., PdfDevice for in-memory output).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.