pub struct GeneratorFixed<'types> { /* private fields */ }
Expand description
Finalized code generator that emits Rust types from resolved schema definitions.
GeneratorFixed
is produced by sealing a Generator
with Generator::into_fixed()
,
locking its configuration and enabling deterministic generation of all required types.
It offers methods to:
- generate a specific type
- generate all named types
- generate all available types
Once generation is complete, use finish
to retrieve the generated
DataTypes
output for rendering.
Implementations§
Source§impl<'types> GeneratorFixed<'types>
impl<'types> GeneratorFixed<'types>
Sourcepub fn generate_type(
self,
ident: Ident,
) -> Result<GeneratorFixed<'types>, Error>
pub fn generate_type( self, ident: Ident, ) -> Result<GeneratorFixed<'types>, Error>
Sourcepub fn generate_all_types(self) -> Result<Self, Error>
pub fn generate_all_types(self) -> Result<Self, Error>
Sourcepub fn generate_named_types(self) -> Result<Self, Error>
pub fn generate_named_types(self) -> Result<Self, Error>
Generate the code for all named types.
This will generate the code for all types with an explicit name and all
dependencies of these types that are specified in the MetaTypes
object
passed to the generator.
§Errors
Raises an Error
if the type generation failed.
§Examples
ⓘ
let generator = Generator::new(types)
.generate_named_types();
Trait Implementations§
Auto Trait Implementations§
impl<'types> Freeze for GeneratorFixed<'types>
impl<'types> !RefUnwindSafe for GeneratorFixed<'types>
impl<'types> !Send for GeneratorFixed<'types>
impl<'types> !Sync for GeneratorFixed<'types>
impl<'types> Unpin for GeneratorFixed<'types>
impl<'types> !UnwindSafe for GeneratorFixed<'types>
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