pub struct TemplateResourceManager { /* private fields */ }
Expand description
Template resource manager for handling CSS/JS resources and placeholders
Implementations§
Source§impl TemplateResourceManager
impl TemplateResourceManager
Sourcepub fn new<P: AsRef<Path>>(template_dir: P) -> Result<Self, BinaryExportError>
pub fn new<P: AsRef<Path>>(template_dir: P) -> Result<Self, BinaryExportError>
Create a new template resource manager
Sourcepub fn process_template(
&mut self,
template_name: &str,
data: &TemplateData,
config: &ResourceConfig,
) -> Result<String, BinaryExportError>
pub fn process_template( &mut self, template_name: &str, data: &TemplateData, config: &ResourceConfig, ) -> Result<String, BinaryExportError>
Load and process a template with resources
Sourcepub fn register_processor(
&mut self,
placeholder: String,
processor: Box<dyn PlaceholderProcessor>,
)
pub fn register_processor( &mut self, placeholder: String, processor: Box<dyn PlaceholderProcessor>, )
Register a custom placeholder processor
Get shared resource content for external use
Get shared JavaScript content for external use
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear resource caches
Auto Trait Implementations§
impl Freeze for TemplateResourceManager
impl !RefUnwindSafe for TemplateResourceManager
impl Send for TemplateResourceManager
impl Sync for TemplateResourceManager
impl Unpin for TemplateResourceManager
impl !UnwindSafe for TemplateResourceManager
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> 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