pub struct Generator { /* private fields */ }
Expand description
OpenAPI generator.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn httpmock(
&mut self,
spec: &OpenAPI,
crate_path: &str,
) -> Result<TokenStream>
pub fn httpmock( &mut self, spec: &OpenAPI, crate_path: &str, ) -> Result<TokenStream>
Generate a strongly-typed mocking extension to the httpmock
crate.
The crate_path
parameter should be a valid Rust path corresponding to
the SDK. This can include ::
and instances of -
in the crate name
should be converted to _
.
Source§impl Generator
impl Generator
Sourcepub fn new(settings: &GenerationSettings) -> Self
pub fn new(settings: &GenerationSettings) -> Self
Create a new generator with default values.
Sourcepub fn generate_tokens(&mut self, spec: &OpenAPI) -> Result<TokenStream>
pub fn generate_tokens(&mut self, spec: &OpenAPI) -> Result<TokenStream>
Emit a TokenStream containing the generated client code.
Sourcepub fn get_type_space(&self) -> &TypeSpace
pub fn get_type_space(&self) -> &TypeSpace
Get the TypeSpace for schemas present in the OpenAPI specification.
Sourcepub fn uses_futures(&self) -> bool
pub fn uses_futures(&self) -> bool
Whether the generated client needs to use additional crates to support futures.
Sourcepub fn uses_websockets(&self) -> bool
pub fn uses_websockets(&self) -> bool
Whether the generated client needs to use additional crates to support websockets.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin 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