Config

Struct Config 

Source
pub struct Config {
    pub parser: ParserConfig,
    pub interpreter: InterpreterConfig,
    pub optimizer: OptimizerConfig,
    pub generator: GeneratorConfig,
    pub renderer: RendererConfig,
}
Expand description

Configuration structure for the generate method.

Fields§

§parser: ParserConfig

Configuration for the schema parser.

§interpreter: InterpreterConfig

Configuration for the schema interpreter.

§optimizer: OptimizerConfig

Configuration for the type information optimizer.

§generator: GeneratorConfig

Configuration for the code generator.

§renderer: RendererConfig

Configuration for the code renderer.

Implementations§

Source§

impl Config

Source

pub fn with_schema(self, schema: Schema) -> Self

Adds the passed schema to the list of schemas to parse.

Source

pub fn with_schemas<I>(self, schemas: I) -> Self
where I: IntoIterator<Item = Schema>,

Adds the passed schemas to the list of schemas to parse.

Source

pub fn set_parser_flags(self, flags: ParserFlags) -> Self

Set parser flags to the config.

Source

pub fn with_parser_flags(self, flags: ParserFlags) -> Self

Add parser flags to the config.

Source

pub fn without_parser_flags(self, flags: ParserFlags) -> Self

Remove parser flags to the config.

Source

pub fn set_interpreter_flags(self, flags: InterpreterFlags) -> Self

Set interpreter flags to the config.

Source

pub fn with_interpreter_flags(self, flags: InterpreterFlags) -> Self

Add code interpreter flags to the config.

Source

pub fn without_interpreter_flags(self, flags: InterpreterFlags) -> Self

Remove code interpreter flags to the config.

Source

pub fn set_optimizer_flags(self, flags: OptimizerFlags) -> Self

Set optimizer flags to the config.

Source

pub fn with_optimizer_flags(self, flags: OptimizerFlags) -> Self

Add optimizer flags to the config.

Source

pub fn without_optimizer_flags(self, flags: OptimizerFlags) -> Self

Remove optimizer flags to the config.

Source

pub fn set_generator_flags(self, flags: GeneratorFlags) -> Self

Set generator flags to the config.

Source

pub fn with_generator_flags(self, flags: GeneratorFlags) -> Self

Add code generator flags to the config.

Source

pub fn without_generator_flags(self, flags: GeneratorFlags) -> Self

Remove code generator flags to the config.

Source

pub fn set_renderer_flags(self, flags: RendererFlags) -> Self

Set renderer flags to the config.

Source

pub fn with_renderer_flags(self, flags: RendererFlags) -> Self

Add code renderer flags to the config.

Source

pub fn without_renderer_flags(self, flags: RendererFlags) -> Self

Remove code renderer flags to the config.

Source

pub fn set_box_flags(self, flags: BoxFlags) -> Self

Set boxing flags to the code generator config.

Source

pub fn with_box_flags(self, flags: BoxFlags) -> Self

Add boxing flags to the code generator config.

Source

pub fn without_box_flags(self, flags: BoxFlags) -> Self

Remove boxing flags to the code generator config.

Source

pub fn with_render_step<T>(self, step: T) -> Self
where T: RenderStepConfig + 'static,

Adds the passed step to the config.

If the same type of renderer was already added, it is replaced by the new one.

Source

pub fn with_render_steps<I>(self, steps: I) -> Self
where I: IntoIterator, I::Item: RenderStepConfig + 'static,

Add multiple renderers to the generator config.

See with_render_step for details.

Source

pub fn with_quick_xml_serialize(self) -> Self

Enable code generation for quick_xml serialization.

Source

pub fn with_quick_xml_serialize_config( self, with_namespaces: bool, default_namespace: Option<Namespace>, ) -> Self

Enable code generation for quick_xml serialization.

Source

pub fn with_quick_xml_deserialize(self) -> Self

Enable code generation for quick_xml deserialization with the default settings.

Source

pub fn with_quick_xml_deserialize_config(self, boxed_deserializer: bool) -> Self

Enable render steps for quick_xml deserialization with the passed configuration.

Source

pub fn with_quick_xml(self) -> Self

Enable render steps for quick_xml serialization and deserialization with the default settings.

Source

pub fn with_quick_xml_config( self, serialize_with_namespaces: bool, default_serialize_namespace: Option<Namespace>, boxed_deserializer: bool, ) -> Self

Enable render steps for quick_xml serialization and deserialization with the passed configuration.

Source

pub fn with_serde_quick_xml(self) -> Self

Enable render steps for types with quick_xml serde support.

Source

pub fn with_serde_xml_rs(self, version: SerdeXmlRsVersion) -> Self

Enable render steps for types with quick_xml serde support.

Source

pub fn with_generate<I>(self, types: I) -> Self

Set the types the code should be generated for.

Source

pub fn with_typedef_mode(self, mode: TypedefMode) -> Self

Set the typedef mode for the generator.

Source

pub fn with_derive<I>(self, derive: I) -> Self
where I: IntoIterator, I::Item: Into<String>,

Set the traits the generated types should derive from.

Source

pub fn with_any_support<S, T>(self, any_type: S, any_attribute_type: T) -> Self
where S: Into<String>, T: Into<String>,

Set the types to use to handle xs:any and xs:anyAttribute elements.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

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 Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

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

Auto Trait Implementations§

§

impl Freeze for Config

§

impl !RefUnwindSafe for Config

§

impl !Send for Config

§

impl !Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

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<X> AsAny for X
where X: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Get a reference to the current object as Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Get a mutable reference to the current object as Any.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,