pub struct TemplateExtension;Expand description
Built-in extension that renders [[extensions.template]] blocks.
Trait Implementations§
Source§impl Extension for TemplateExtension
impl Extension for TemplateExtension
Source§fn parse_config(&self, raw: Option<&Value>) -> Result<ExtensionConfig>
fn parse_config(&self, raw: Option<&Value>) -> Result<ExtensionConfig>
Parse this extension’s TOML section. Read more
Source§fn emit_for_language(
&self,
api: &ApiSurface,
cfg: &ExtensionConfig,
language: Language,
_env: &TemplateEnv,
) -> Result<Vec<GeneratedFile>>
fn emit_for_language( &self, api: &ApiSurface, cfg: &ExtensionConfig, language: Language, _env: &TemplateEnv, ) -> Result<Vec<GeneratedFile>>
Emit extra files for one language. Read more
Source§fn augment_surface(
&self,
_api: &mut ApiSurface,
_cfg: &ExtensionConfig,
) -> Result<()>
fn augment_surface( &self, _api: &mut ApiSurface, _cfg: &ExtensionConfig, ) -> Result<()>
Augment the API surface after extraction and before generation. Read more
Source§fn transform_emitted_files(
&self,
_api: &ApiSurface,
_cfg: &ExtensionConfig,
_language: Language,
_files: &mut Vec<GeneratedFile>,
_env: &TemplateEnv,
) -> Result<()>
fn transform_emitted_files( &self, _api: &ApiSurface, _cfg: &ExtensionConfig, _language: Language, _files: &mut Vec<GeneratedFile>, _env: &TemplateEnv, ) -> Result<()>
Transform the complete file list for one language after backend generation
and after
Extension::emit_for_language has appended any extension-owned files. Read moreSource§fn transform_scaffold_files(
&self,
_api: &ApiSurface,
_cfg: &ExtensionConfig,
_language: Language,
_files: &mut Vec<GeneratedFile>,
_env: &TemplateEnv,
) -> Result<()>
fn transform_scaffold_files( &self, _api: &ApiSurface, _cfg: &ExtensionConfig, _language: Language, _files: &mut Vec<GeneratedFile>, _env: &TemplateEnv, ) -> Result<()>
Transform the scaffold-pass file list for one language before it is written. Read more
Source§fn public_api_additions(
&self,
_api: &ApiSurface,
_cfg: &ExtensionConfig,
_language: Language,
) -> Result<Vec<String>>
fn public_api_additions( &self, _api: &ApiSurface, _cfg: &ExtensionConfig, _language: Language, ) -> Result<Vec<String>>
Contribute raw lines to the package’s public-API init file for one
language (e.g. Python’s
__init__.py). Read moreSource§fn emit_e2e(
&self,
_groups: &[FixtureGroup],
_e2e_config: &E2eConfig,
_config: &ResolvedCrateConfig,
_language: &str,
_type_defs: &[TypeDef],
_enums: &[EnumDef],
) -> Result<Vec<GeneratedFile>>
fn emit_e2e( &self, _groups: &[FixtureGroup], _e2e_config: &E2eConfig, _config: &ResolvedCrateConfig, _language: &str, _type_defs: &[TypeDef], _enums: &[EnumDef], ) -> Result<Vec<GeneratedFile>>
Emit e2e test files for one language. Read more
Auto Trait Implementations§
impl Freeze for TemplateExtension
impl RefUnwindSafe for TemplateExtension
impl Send for TemplateExtension
impl Sync for TemplateExtension
impl Unpin for TemplateExtension
impl UnsafeUnpin for TemplateExtension
impl UnwindSafe for TemplateExtension
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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