pub trait Plugin: Send + Sync {
// Required method
fn name(&self) -> &str;
// Provided methods
fn on_init<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut InitContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_build_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut BuildContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_content_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ContentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_graph_updated<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut GraphContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_validation_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ValidationContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_page_render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RenderContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_build_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut OutputContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_file_changed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut WatchContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
The core plugin trait. All lifecycle hooks have default no-op implementations.
Plugins can be implemented in Rust (loaded as cdylib) or in TypeScript (proxied via Deno).
Required Methods§
Provided Methods§
Sourcefn on_init<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut InitContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_init<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut InitContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called once when the plugin is first loaded.
Sourcefn on_build_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut BuildContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_build_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut BuildContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called at the start of each build.
Sourcefn on_content_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ContentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_content_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ContentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called after each content file is parsed.
Sourcefn on_graph_updated<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut GraphContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_graph_updated<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut GraphContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called after all content is ingested into the RDF graph.
Sourcefn on_validation_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ValidationContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_validation_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut ValidationContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called after SHACL validation completes.
Sourcefn on_page_render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RenderContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_page_render<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut RenderContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called before rendering each page.
Sourcefn on_build_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut OutputContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_build_complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut OutputContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called after all output files are written.
Sourcefn on_file_changed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut WatchContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_file_changed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut WatchContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called when a file change is detected during dev server.