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 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.
Implementations
impl BuilderPattern
[src]
impl BuilderPattern
[src]pub fn requires_clone(&self) -> bool
[src]
Returns true if this style of builder needs to be able to clone its
fields during the build
method.
Trait Implementations
impl Clone for BuilderPattern
[src]
impl Clone for BuilderPattern
[src]fn clone(&self) -> BuilderPattern
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl FromMeta for BuilderPattern
[src]
impl FromMeta for BuilderPattern
[src]fn from_list(__outer: &[NestedMeta]) -> Result<Self>
[src]
fn from_string(lit: &str) -> Result<Self>
[src]
pub fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
[src]
pub fn from_meta(item: &Meta) -> Result<Self, Error>
[src]
pub fn from_word() -> Result<Self, Error>
[src]
pub fn from_value(value: &Lit) -> Result<Self, Error>
[src]
pub fn from_char(value: char) -> Result<Self, Error>
[src]
pub fn from_bool(value: bool) -> Result<Self, Error>
[src]
impl PartialEq<BuilderPattern> for BuilderPattern
[src]
impl PartialEq<BuilderPattern> for BuilderPattern
[src]