Struct derive_builder_core::Setter[][src]

pub struct Setter<'a> {
    pub enabled: bool,
    pub try_setter: bool,
    pub visibility: Visibility,
    pub pattern: BuilderPattern,
    pub attrs: &'a [Attribute],
    pub ident: Ident,
    pub field_ident: &'a Ident,
    pub field_type: &'a Type,
    pub generic_into: bool,
    pub deprecation_notes: &'a DeprecationNotes,
    pub bindings: Bindings,
}

Setter for the struct fields in the build method, implementing quote::ToTokens.

Examples

Will expand to something like the following (depending on settings):

pub fn foo(&mut self, value: Foo) -> &mut Self {
    let mut new = self;
    new.foo = ::std::option::Option::Some(value);
    new
}

Fields

Enables code generation for this setter fn.

Enables code generation for the try_ variant of this setter fn.

Visibility of the setter, e.g. syn::Visibility::Public.

How the setter method takes and returns self (e.g. mutably).

Attributes which will be attached to this setter fn.

Name of this setter fn.

Name of the target field.

Type of the target field.

The corresonding builder field will be Option<field_type>.

Make the setter generic over Into<T>, where T is the field type.

Emit deprecation notes to the user.

Bindings to libstd or libcore.

Trait Implementations

impl<'a> Debug for Setter<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Clone for Setter<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> ToTokens for Setter<'a>
[src]

Write self to the given Tokens. Read more

Convert self directly into a Tokens object. Read more

Auto Trait Implementations

impl<'a> !Send for Setter<'a>

impl<'a> !Sync for Setter<'a>