pub fn with_defaults(self, defaults: &Self) -> Self {
        let mut deprecation_notes = self.mode.deprecation_notes;
        deprecation_notes.extend(&defaults.mode.deprecation_notes);

        // move a nested field out of `self`, if it is `Some(_)` or else clone it from `defaults`
        macro_rules! f {
            ($($field:ident).*) => {
                self.$($field).*.or_else(|| defaults.$($field).*.clone())
            };
        }

        let mode = FieldMode {
            field_ident: self.mode.field_ident,
            field_type: self.mode.field_type,
            setter_attrs: f!(mode.setter_attrs),
            deprecation_notes: deprecation_notes,
            use_default_struct: self.mode.use_default_struct || defaults.mode.use_default_struct,
        };

        OptionsBuilder::<FieldMode> {
            setter_enabled: f!(setter_enabled),
            builder_pattern: f!(builder_pattern),
            setter_name: f!(setter_name),
            setter_prefix: f!(setter_prefix),
            setter_vis: f!(setter_vis),
            field_vis: f!(field_vis),
            default_expression: f!(default_expression),
            setter_into: f!(setter_into),
            try_setter: f!(try_setter),
            no_std: f!(no_std),
            mode: mode,
        }
    }
/// If any field is `None`, we fallback to the supplied default value.
If any field is `None`, we fallback to the supplied default value.
If any field is ` None ` we fallback to the supplied default value .
pub fn with_defaults(self, defaults: &Self) -> Self {
        let mut deprecation_notes = self.mode.deprecation_notes;
        deprecation_notes.extend(&defaults.mode.deprecation_notes);
        // move a nested field out of `self`, if it is `Some(_)` or else clone it from `defaults`
        macro_rules! f {
            ($($field:ident).*) => {
                self.$($field).*.or_else(|| defaults.$($field).*.clone())
            };
        }
        let mode = FieldMode {
            field_ident: self.mode.field_ident,
            field_type: self.mode.field_type,
            setter_attrs: f!(mode.setter_attrs),
            deprecation_notes: deprecation_notes,
            use_default_struct: self.mode.use_default_struct || defaults.mode.use_default_struct,
        };
        OptionsBuilder::<FieldMode> {
            setter_enabled: f!(setter_enabled),
            builder_pattern: f!(builder_pattern),
            setter_name: f!(setter_name),
            setter_prefix: f!(setter_prefix),
            setter_vis: f!(setter_vis),
            field_vis: f!(field_vis),
            default_expression: f!(default_expression),
            setter_into: f!(setter_into),
            try_setter: f!(try_setter),
            no_std: f!(no_std),
            mode: mode,
        }
    }
pub fn with_defaults ( self , defaults : & Self ) -> Self { let mut deprecation_notes = self . mode . deprecation_notes ; deprecation_notes . extend ( & defaults . mode . deprecation_notes ) ; // move a nested field out of `self`, if it is `Some(_)` or else clone it from `defaults` macro_rules! f { ( $ ( $field : ident ) * ) => { self $ ( $field ) * or_else ( defaults $ ( $field ) * clone ( ) ) } ; } let mode = FieldMode { field_ident : self . mode . field_ident , field_type : self . mode . field_type , setter_attrs : f ! ( mode setter_attrs ) , deprecation_notes : deprecation_notes , use_default_struct : self . mode . use_default_struct || defaults . mode . use_default_struct , } ; OptionsBuilder :: < FieldMode > { setter_enabled : f ! ( setter_enabled ) , builder_pattern : f ! ( builder_pattern ) , setter_name : f ! ( setter_name ) , setter_prefix : f ! ( setter_prefix ) , setter_vis : f ! ( setter_vis ) , field_vis : f ! ( field_vis ) , default_expression : f ! ( default_expression ) , setter_into : f ! ( setter_into ) , try_setter : f ! ( try_setter ) , no_std : f ! ( no_std ) , mode : mode , } }
If any field is `None`, we fallback to the supplied default value.
If any field is ` None ` we fallback to the supplied default value .
self
defaults
&Self
self
defaults
&Self