pub trait GenerationHooks: Send + Sync {
type Error: From<Error> + Send;
// Provided methods
fn rename(
&self,
_paths: &[String],
) -> impl Future<Output = Result<Option<Vec<String>>, Self::Error>> + Send { ... }
fn has_css_context(&self) -> bool { ... }
fn has_html_context(&self) -> bool { ... }
fn css_context(
&self,
context: Map<String, Value>,
) -> impl Future<Output = Result<Map<String, Value>, Self::Error>> + Send { ... }
fn html_context(
&self,
context: Map<String, Value>,
) -> impl Future<Output = Result<Map<String, Value>, Self::Error>> + Send { ... }
}Expand description
Async hooks used by crate::generate_with_hooks.
Rename receives ordered paths after source loading, flattened in configured variant order.
Return None to derive names from file stems. Context hooks run only when their matching
has_*_context method returns true; CSS runs before HTML. Callback errors are preserved
through the associated error type, while engine failures are converted from I/O errors.
Required Associated Types§
Provided Methods§
Sourcefn rename(
&self,
_paths: &[String],
) -> impl Future<Output = Result<Option<Vec<String>>, Self::Error>> + Send
fn rename( &self, _paths: &[String], ) -> impl Future<Output = Result<Option<Vec<String>>, Self::Error>> + Send
Resolve one glyph name per borrowed path, or use the engine’s defaults. Adapters that need an owned callback payload can copy paths inside this method.
Sourcefn has_css_context(&self) -> bool
fn has_css_context(&self) -> bool
Whether CSS context mutation is enabled.
Sourcefn has_html_context(&self) -> bool
fn has_html_context(&self) -> bool
Whether HTML context mutation is enabled.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".