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 ofSelf
. - 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]
impl BuilderPattern
pub fn requires_clone(&self) -> bool
[src]
pub fn requires_clone(&self) -> bool
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]
impl PartialEq for BuilderPattern
fn eq(&self, __arg_0: &BuilderPattern) -> bool
[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[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Eq for BuilderPattern
[src]
impl Eq for BuilderPattern
impl Debug for BuilderPattern
[src]
impl Debug for BuilderPattern
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for BuilderPattern
[src]
impl Clone for BuilderPattern
fn clone(&self) -> BuilderPattern
[src]
fn clone(&self) -> BuilderPattern
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for BuilderPattern
[src]
impl Copy for BuilderPattern
impl Default for BuilderPattern
[src]
impl Default for BuilderPattern
Defaults to Mutable
.
fn default() -> BuilderPattern
[src]
fn default() -> BuilderPattern
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for BuilderPattern
impl Send for BuilderPattern
impl Sync for BuilderPattern
impl Sync for BuilderPattern