[−][src]Enum derive_builder_core::BuilderPattern
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]
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 Eq for BuilderPattern
[src]
impl PartialEq<BuilderPattern> for BuilderPattern
[src]
fn eq(&self, other: &BuilderPattern) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for BuilderPattern
[src]
fn clone(&self) -> BuilderPattern
[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 Default for BuilderPattern
[src]
Defaults to Mutable
.
fn default() -> BuilderPattern
[src]
impl Debug for BuilderPattern
[src]
impl FromMeta for BuilderPattern
[src]
fn from_list(__outer: &[NestedMeta]) -> Result<Self>
[src]
fn from_string(lit: &str) -> Result<Self>
[src]
fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
fn from_meta(item: &Meta) -> Result<Self, Error>
Create an instance from a syn::Meta
by dispatching to the format-appropriate trait function. This generally should not be overridden by implementers. Read more
fn from_word() -> Result<Self, Error>
Create an instance from the presence of the word in the attribute with no additional options specified. Read more
fn from_value(value: &Lit) -> Result<Self, Error>
Create an instance from a literal value of either foo = "bar"
or foo("bar")
. This dispatches to the appropriate method based on the type of literal encountered, and generally should not be overridden by implementers. Read more
fn from_char(value: char) -> Result<Self, Error>
Create an instance from a char literal in a value position.
fn from_bool(value: bool) -> Result<Self, Error>
Create an instance from a bool literal in a value position.
Auto Trait Implementations
impl Send for BuilderPattern
impl Sync for BuilderPattern
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,