Struct tighterror_build::CodegenOptions
source · pub struct CodegenOptions { /* private fields */ }Expand description
Options for the code generator.
This struct is a builder for the code generator options.
Examples
CodegenOptions::new()
.spec("tighterror.yaml".to_owned())
.dst("src/errors.rs".to_owned())
.codegen()?;Implementations§
source§impl CodegenOptions
impl CodegenOptions
sourcepub fn spec(&mut self, spec: impl Into<Option<String>>) -> &mut Self
pub fn spec(&mut self, spec: impl Into<Option<String>>) -> &mut Self
Sets the specification file path.
If not specified the path DEFAULT_SPEC_PATH is used.
Examples
CodegenOptions::new().spec(None);
CodegenOptions::new().spec("tighterror.yaml".to_owned());
CodegenOptions::new().spec(Some("myerrors.toml".into()));sourcepub fn dst(&mut self, dst: impl Into<Option<String>>) -> &mut Self
pub fn dst(&mut self, dst: impl Into<Option<String>>) -> &mut Self
Sets the destination file path.
If the value is "-", or destination file path is not set at all, the
output is written to stdout.
A value specified here overrides the one present in the specification file.
Examples
CodegenOptions::new().dst(None);
CodegenOptions::new().dst("src/errors.rs".to_owned());
CodegenOptions::new().dst(Some("myerrors.rs".into()));Trait Implementations§
source§impl Clone for CodegenOptions
impl Clone for CodegenOptions
source§fn clone(&self) -> CodegenOptions
fn clone(&self) -> CodegenOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for CodegenOptions
impl Debug for CodegenOptions
source§impl Default for CodegenOptions
impl Default for CodegenOptions
source§fn default() -> CodegenOptions
fn default() -> CodegenOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for CodegenOptions
impl Send for CodegenOptions
impl Sync for CodegenOptions
impl Unpin for CodegenOptions
impl UnwindSafe for CodegenOptions
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