pub struct Generator {
pub external_resource_paths: Vec<PathBuf>,
pub cache_root: PathBuf,
/* private fields */
}Expand description
A class to represent an image generator.
The given Layout describes how to generate the Image.
This struct caches the font database and font source client to avoid
re-initializing them on every render() call.
Fields§
§external_resource_paths: Vec<PathBuf>Search paths used to resolve input images, SVG files, or font files.
cache_root: PathBufThe root directory used for renderer cache data such as downloaded fonts.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn new(
external_resource_paths: Vec<PathBuf>,
cache_root: Option<PathBuf>,
) -> Result<Generator, ImgGenRendererError>
pub fn new( external_resource_paths: Vec<PathBuf>, cache_root: Option<PathBuf>, ) -> Result<Generator, ImgGenRendererError>
Create a new Generator with the given image search paths.
This initializes the shared font database and font source client once. Both are cached in-memory and reused across all subsequent renders.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Generator
impl !RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnsafeUnpin for Generator
impl !UnwindSafe for Generator
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more