[][src]Struct conjure_codegen::Config

pub struct Config { /* fields omitted */ }

Codegen configuration.

Methods

impl Config[src]

pub fn new() -> Config[src]

Creates a new Config with default settings.

pub fn exhaustive(&mut self, exhaustive: bool) -> &mut Config[src]

Controls exhaustive matchability of unions and enums.

Non-exhaustive unions and enums have the ability to deserialize and reserialize unknown variants. This enables clients to be more forward-compatible with changes made by newer servers.

Defaults to false.

pub fn run_rustfmt(&mut self, run_rustfmt: bool) -> &mut Config[src]

Controls the use of rustfmt to format generated source code.

Defaults to true.

pub fn rustfmt<T>(&mut self, rustfmt: T) -> &mut Config where
    T: AsRef<OsStr>, 
[src]

Sets the name of the binary used to format source code.

Defaults to the value of the RUSTFMT environment variable, or rustfmt if not set.

pub fn strip_prefix<T>(&mut self, strip_prefix: T) -> &mut Config where
    T: Into<Option<String>>, 
[src]

Sets a prefix that will be stripped from package names.

Defaults to None.

pub fn generate_files<P, Q>(&self, ir_file: P, out_dir: Q) -> Result<(), Error> where
    P: AsRef<Path>,
    Q: AsRef<Path>, 
[src]

Generates Rust source files from a JSON-encoded Conjure IR file.

Trait Implementations

impl Default for Config[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]