pub trait Plugin<L: Language>:
Send
+ Sync
+ 'static {
// Required methods
fn kind(&self) -> &'static str;
fn meta(&self) -> &Meta;
fn generate(&self, cx: &mut PluginContext<'_, L>) -> Result<()>;
// Provided methods
fn phase(&self) -> PluginPhase { ... }
fn enforce(&self) -> Enforce { ... }
fn supports_native_input(&self) -> bool { ... }
fn requires(&self) -> Vec<Requirement> { ... }
fn provides(&self) -> Vec<Provision> { ... }
}Required Methods§
fn kind(&self) -> &'static str
fn meta(&self) -> &Meta
fn generate(&self, cx: &mut PluginContext<'_, L>) -> Result<()>
Provided Methods§
Sourcefn phase(&self) -> PluginPhase
fn phase(&self) -> PluginPhase
Selects the plugin lifecycle phase. The default honors Self::enforce
so a post plugin only needs to override that shorthand.
Sourcefn supports_native_input(&self) -> bool
fn supports_native_input(&self) -> bool
Opt in when this plugin reads protocol contracts instead of the legacy HTTP context. Native generation skips packages containing HTTP-only plugins before loading sources.
fn requires(&self) -> Vec<Requirement>
fn provides(&self) -> Vec<Provision>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".