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
OwnedE.g. fn bar(self, bar: Bar) -> Self.
MutableE.g. fn bar(&mut self, bar: Bar) -> &mut Self.
ImmutableE.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]
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]
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) -> bool1.0.0
This method tests for !=.
impl Eq for BuilderPattern[src]
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