pub struct EsFluentGenerator { /* private fields */ }Expand description
Builder for generating FTL files from registered types.
Uses the inventory crate to collect all types registered via
#[derive(EsFluent)], #[derive(EsFluentKv)], or #[derive(EsFluentThis)].
§Example
ⓘ
use es_fluent::EsFluentGenerator;
fn main() {
// Uses defaults from i18n.toml and auto-detects crate name
EsFluentGenerator::builder()
.build()
.generate()
.expect("Failed to generate FTL files");
// Or with custom settings
EsFluentGenerator::builder()
.mode(es_fluent::FluentParseMode::Aggressive)
.output_path("custom/path")
.build()
.generate()
.expect("Failed to generate FTL files");
}Implementations§
Source§impl EsFluentGenerator
impl EsFluentGenerator
Sourcepub fn builder() -> EsFluentGeneratorBuilder
pub fn builder() -> EsFluentGeneratorBuilder
Create an instance of EsFluentGenerator using the builder syntax
Source§impl EsFluentGenerator
impl EsFluentGenerator
Sourcepub fn generate(&self) -> Result<(), GeneratorError>
pub fn generate(&self) -> Result<(), GeneratorError>
Generates FTL files from all registered types.
Auto Trait Implementations§
impl Freeze for EsFluentGenerator
impl RefUnwindSafe for EsFluentGenerator
impl Send for EsFluentGenerator
impl Sync for EsFluentGenerator
impl Unpin for EsFluentGenerator
impl UnwindSafe for EsFluentGenerator
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