Skip to main content

RenderError

Enum RenderError 

Source
pub enum RenderError {
    Font(FontError),
    Image(ImageEmbedError),
    MissingFont(FontKey),
    PdfAFeatureDisabled,
    ZugferdFeatureDisabled,
    TaggedPdfFeatureDisabled,
    NoFontsRegistered,
}

Variants§

§

Font(FontError)

§

Image(ImageEmbedError)

§

MissingFont(FontKey)

A Text used a FontKey (e.g. via .font(key), or .italic() when no italic was registered) that FontRegistry has nothing registered under — a typed error instead of silently substituting the registry’s default font.

§

PdfAFeatureDisabled

Document::pdf_a3b() was set but this crate wasn’t compiled with the pdf-a feature — a clear error instead of silently rendering a non-conformant PDF the caller believes is PDF/A-3b (issue #25).

§

ZugferdFeatureDisabled

Document::zugferd_xml() was set but this crate wasn’t compiled with the zugferd feature (issue #26) — same reasoning as PdfAFeatureDisabled.

§

TaggedPdfFeatureDisabled

Document::pdf_ua() was set but this crate wasn’t compiled with the tagged-pdf feature (issue #27) — same reasoning as PdfAFeatureDisabled.

§

NoFontsRegistered

render_with_fonts/render_with_fonts_and_diagnostics were called with a FontRegistry nothing was ever registered on — layout has no error channel of its own (every width/wrap lookup just falls back to whatever FontRegistry::entry finds), so this is checked up front instead of surfacing as a panic once layout starts.

Trait Implementations§

Source§

impl Debug for RenderError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RenderError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<FontError> for RenderError

Source§

fn from(e: FontError) -> Self

Converts to this type from the input type.
Source§

impl From<ImageEmbedError> for RenderError

Source§

fn from(e: ImageEmbedError) -> Self

Converts to this type from the input type.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.