pub struct Generator { /* private fields */ }Expand description
Main generator that coordinates all the pieces.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn spec(&self) -> &ParsedSpec
pub fn spec(&self) -> &ParsedSpec
Get the parsed spec.
Sourcepub fn type_generator(&self) -> &TypeGenerator
pub fn type_generator(&self) -> &TypeGenerator
Get the type generator.
Sourcepub fn generate_types(&self) -> TokenStream
pub fn generate_types(&self) -> TokenStream
Generate all types as a TokenStream.
Sourcepub fn generate_responses(&self) -> TokenStream
pub fn generate_responses(&self) -> TokenStream
Generate response enums for all operations.
Sourcepub fn get_operation(
&self,
method: HttpMethod,
path: &str,
) -> Option<&Operation>
pub fn get_operation( &self, method: HttpMethod, path: &str, ) -> Option<&Operation>
Look up an operation by HTTP method and path.
Sourcepub fn operations(&self) -> impl Iterator<Item = &Operation>
pub fn operations(&self) -> impl Iterator<Item = &Operation>
Get all operations.
Sourcepub fn validate_coverage(
&self,
covered: &HashMap<(HttpMethod, String), ()>,
) -> Result<()>
pub fn validate_coverage( &self, covered: &HashMap<(HttpMethod, String), ()>, ) -> Result<()>
Validate that all operations are covered by trait methods.
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin for Generator
impl UnsafeUnpin for Generator
impl UnwindSafe for Generator
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