Struct derive_builder_core::Builder [] [src]

pub struct Builder<'a> {
    pub enabled: bool,
    pub ident: &'a Ident,
    pub pattern: BuilderPattern,
    pub derives: &'a [Ident],
    pub generics: Option<&'a Generics>,
    pub visibility: &'a Visibility,
    pub fields: Vec<Tokens>,
    pub functions: Vec<Tokens>,
    pub doc_comment: Option<Attribute>,
    pub deprecation_notes: DeprecationNotes,
    pub bindings: Bindings,
}

Builder, implementing quote::ToTokens.

Examples

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

#[derive(Default, Clone)]
pub struct FooBuilder {
    foo: u32,
}

#[allow(dead_code)]
impl FooBuilder {
    fn bar () -> {
        unimplemented!()
    }
}

Fields

Enables code generation for this builder struct.

Name of this builder struct.

Pattern of this builder struct.

Traits to automatically derive on the builder type.

Type parameters and lifetimes attached to this builder's struct definition.

Visibility of the builder struct, e.g. syn::Visibility::Public.

Fields of the builder struct, e.g. foo: u32,

Expects each entry to be terminated by a comma.

Functions of the builder struct, e.g. fn bar() -> { unimplemented!() }

Doc-comment of the builder struct.

Emit deprecation notes to the user.

Library bindings to use in emitted builder.

Methods

impl<'a> Builder<'a>
[src]

Set a doc-comment for this item.

Add a field to the builder

Add a setter function to the builder

Add final build function to the builder

Trait Implementations

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

Formats the value using the given formatter.

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

Write self to the given Tokens. Read more