Enum derive_builder_core::BuilderPattern [] [src]

pub enum BuilderPattern {
    Owned,
    Mutable,
    Immutable,
}

Controls the signature of a setter method, more specifically how self is passed and returned.

It can also be generalized to methods with different parameter sets and return types, e.g. the build() method.

Variants

E.g. fn bar(self, bar: Bar) -> Self.

E.g. fn bar(&mut self, bar: Bar) -> &mut Self.

E.g. fn bar(&self, bar: Bar) -> Self.

Note: - Needs to clone in order to return an updated instance of Self. - There is a great chance that the Rust compiler (LLVM) will optimize chained clone calls away in release mode. Therefore this turns out not to be as bad as it sounds.

Methods

impl BuilderPattern
[src]

Returns true if this style of builder needs to be able to clone its fields during the build method.

Trait Implementations

impl PartialEq for BuilderPattern
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for BuilderPattern
[src]

impl Debug for BuilderPattern
[src]

Formats the value using the given formatter.

impl Clone for BuilderPattern
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for BuilderPattern
[src]

impl Default for BuilderPattern
[src]

Defaults to Mutable.

Returns the "default value" for a type. Read more