#[non_exhaustive]pub struct Config<'a> {Show 13 fields
pub dbc_name: &'a str,
pub dbc_content: &'a str,
pub debug_prints: bool,
pub impl_debug: FeatureConfig<'a>,
pub impl_defmt: FeatureConfig<'a>,
pub impl_arbitrary: FeatureConfig<'a>,
pub impl_serde: FeatureConfig<'a>,
pub impl_error: FeatureConfig<'a>,
pub impl_embedded_can_frame: FeatureConfig<'a>,
pub check_ranges: FeatureConfig<'a>,
pub allow_dead_code: bool,
pub padding_bit_value: bool,
pub attribute_structs: &'a [AttributeStruct<'a>],
}Expand description
Code generator configuration. See module-level docs for an example.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dbc_name: &'a strName of the dbc-file. Used for generated docs only.
dbc_content: &'a strContent of a dbc-file as a UTF-8 string. Use can_dbc::decode_cp1252 or other encodings if needed.
debug_prints: boolOptional: Print debug info to stdout while generating code. Default: false.
impl_debug: FeatureConfig<'a>Optional: impl Debug for generated types. Default: Never.
impl_defmt: FeatureConfig<'a>Optional: impl defmt::Format for generated types. Default: Never.
impl_arbitrary: FeatureConfig<'a>Optional: impl Arbitrary for generated types. Default: Never.
impl_serde: FeatureConfig<'a>Optional: impl Serialize and impl Deserialize for generated types.. Default: Never.
impl_error: FeatureConfig<'a>Optional: impl core::error::Error for the generated CanError type. Default: Never.
impl_embedded_can_frame: FeatureConfig<'a>Optional: Generate embedded_can::Frame impl for each frame. Default: Always
check_ranges: FeatureConfig<'a>Optional: Validate min and max values in generated signal setters. Default: Always
allow_dead_code: boolOptional: Allow dead code in the generated module. Default: false.
padding_bit_value: boolOptional: Padding bit value used; set all unused bits to 1 if true else to 0. Default: false.
attribute_structs: &'a [AttributeStruct<'a>]Optional: User-defined structs populated from DBC attributes. These are emitted as associated constants in the generated message types. Default: empty.
Implementations§
Source§impl<'a> Config<'a>
impl<'a> Config<'a>
Sourcepub fn builder() -> ConfigBuilder<'a, ((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ConfigBuilder<'a, ((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Config.
On the builder, call .dbc_name(...), .dbc_content(...), .debug_prints(...)(optional), .impl_debug(...)(optional), .impl_defmt(...)(optional), .impl_arbitrary(...)(optional), .impl_serde(...)(optional), .impl_error(...)(optional), .impl_embedded_can_frame(...)(optional), .check_ranges(...)(optional), .allow_dead_code(...)(optional), .padding_bit_value(...)(optional), .attribute_structs(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Config.