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
Owned
E.g. fn bar(self, bar: Bar) -> Self
.
Mutable
E.g. fn bar(&mut self, bar: Bar) -> &mut Self
.
Immutable
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.
Trait Implementations
impl PartialEq for BuilderPattern
[src]
fn eq(&self, __arg_0: &BuilderPattern) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Debug for BuilderPattern
[src]
impl Clone for BuilderPattern
[src]
fn clone(&self) -> BuilderPattern
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for BuilderPattern
[src]
impl Default for BuilderPattern
[src]
Defaults to Mutable
.
fn default() -> BuilderPattern
Returns the "default value" for a type. Read more