Struct serdegen::Options [−][src]
pub(crate) struct Options {
input: Option<PathBuf>,
language: Language,
target_source_dir: Option<PathBuf>,
with_runtimes: Vec<Runtime>,
module_name: Option<String>,
serde_package_name: Option<String>,
use_c_style_enums: bool,
}Fields
input: Option<PathBuf>Path to the YAML-encoded Serde formats.
language: LanguageLanguage for code generation.
target_source_dir: Option<PathBuf>Directory where to write generated modules (otherwise print code on stdout).
with_runtimes: Vec<Runtime>Optional runtimes to install in the target_source_dir (if applicable).
Also triggers the generation of specialized methods for each runtime.
module_name: Option<String>Module name for the Serde formats installed in the target_source_dir.
Rust crates may contain a version number separated with a colon, e.g. “test:1.2.0”.
(By default, the installer will use version “0.1.0”.)
serde_package_name: Option<String>Optional package name (Python) or module path (Go) where to find Serde runtime dependencies.
use_c_style_enums: boolTranslate enums without variant data (c-style enums) into their equivalent in the target language, if the target language and the generator code support them.
Trait Implementations
Builds the struct from clap::ArgMatches. It’s guaranteed to succeed
if matches originates from an App generated by StructOpt::clap called on
the same type, otherwise it must panic. Read more
Builds the struct from the command line arguments (std::env::args_os).
Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more
Builds the struct from the command line arguments (std::env::args_os).
Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program,
so calling .exit is up to you. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec of your making.
Print the error message and quit the program in case of failure. Read more
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec of your making. Read more