Struct GenerationSettings

Source
pub struct GenerationSettings { /* private fields */ }
Expand description

Settings for Generator.

Implementations§

Source§

impl GenerationSettings

Source

pub fn new() -> Self

Create new generator settings with default values.

Source

pub fn with_interface(&mut self, interface: InterfaceStyle) -> &mut Self

Set the InterfaceStyle.

Source

pub fn with_tag(&mut self, tag: TagStyle) -> &mut Self

Set the TagStyle.

Source

pub fn with_inner_type(&mut self, inner_type: TokenStream) -> &mut Self

Client inner type available to pre and post hooks.

Source

pub fn with_pre_hook(&mut self, pre_hook: TokenStream) -> &mut Self

Hook invoked before issuing the HTTP request.

Source

pub fn with_pre_hook_async(&mut self, pre_hook: TokenStream) -> &mut Self

Hook invoked before issuing the HTTP request.

Source

pub fn with_post_hook(&mut self, post_hook: TokenStream) -> &mut Self

Hook invoked prior to receiving the HTTP response.

Source

pub fn with_post_hook_async(&mut self, post_hook: TokenStream) -> &mut Self

Hook invoked prior to receiving the HTTP response.

Source

pub fn with_derive(&mut self, derive: impl ToString) -> &mut Self

Additional derive macros applied to generated types.

Source

pub fn with_patch<S: AsRef<str>>( &mut self, type_name: S, patch: &TypePatch, ) -> &mut Self

Modify a type with the given name. See typify::TypeSpaceSettings::with_patch.

Source

pub fn with_replacement<TS: ToString, RS: ToString, I: Iterator<Item = TypeImpl>>( &mut self, type_name: TS, replace_name: RS, impls: I, ) -> &mut Self

Replace a referenced type with a named type. See typify::TypeSpaceSettings::with_replacement.

Source

pub fn with_conversion<S: ToString, I: Iterator<Item = TypeImpl>>( &mut self, schema: SchemaObject, type_name: S, impls: I, ) -> &mut Self

Replace a given schema with a named type. See typify::TypeSpaceSettings::with_conversion.

Source

pub fn with_unknown_crates(&mut self, policy: UnknownPolicy) -> &mut Self

Policy regarding crates referenced by the schema extension x-rust-type not explicitly specified via Self::with_crate. See typify::TypeSpaceSettings::with_unknown_crates.

Source

pub fn with_crate<S1: ToString>( &mut self, crate_name: S1, version: CrateVers, rename: Option<&String>, ) -> &mut Self

Explicitly named crates whose types may be used during generation rather than generating new types based on their schemas (base on the presence of the x-rust-type extension). See typify::TypeSpaceSettings::with_crate.

Source

pub fn with_map_type<MT: ToString>(&mut self, map_type: MT) -> &mut Self

Set the type used for key-value maps. Common examples:

The requiremnets for a map type can be found in the typify::TypeSpaceSettings::with_map_type documentation.

Trait Implementations§

Source§

impl Clone for GenerationSettings

Source§

fn clone(&self) -> GenerationSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for GenerationSettings

Source§

fn default() -> GenerationSettings

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.