[−][src]Struct derive_builder_core::Setter
Setter for the struct fields in the build method, implementing
quote::ToTokens
.
Examples
Will expand to something like the following (depending on settings):
pub fn foo(&mut self, value: Foo) -> &mut Self { let mut new = self; new.foo = ::std::option::Option::Some(value); new }
Fields
enabled: bool
Enables code generation for this setter fn.
try_setter: bool
Enables code generation for the try_
variant of this setter fn.
visibility: Visibility
Visibility of the setter, e.g. syn::Visibility::Public
.
pattern: BuilderPattern
How the setter method takes and returns self
(e.g. mutably).
attrs: &'a [Attribute]
Attributes which will be attached to this setter fn.
ident: Ident
Name of this setter fn.
field_ident: &'a Ident
Name of the target field.
field_type: &'a Type
Type of the target field.
The corresonding builder field will be Option<field_type>
.
generic_into: bool
Make the setter generic over Into<T>
, where T
is the field type.
strip_option: bool
Make the setter remove the Option wrapper from the setter, remove the need to call Some(...). when combined with into, the into is used on the content Type of the Option.
deprecation_notes: &'a DeprecationNotes
Emit deprecation notes to the user.
bindings: Bindings
Bindings to libstd or libcore.
Trait Implementations
impl<'a> Clone for Setter<'a>
[src]
fn clone(&self) -> Setter<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for Setter<'a>
[src]
impl<'a> ToTokens for Setter<'a>
[src]
fn to_tokens(&self, tokens: &mut TokenStream)
[src]
fn into_token_stream(self) -> TokenStream
[src]
Convert self
directly into a TokenStream
object. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
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, 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,
impl<T> Spanned for T where
T: ToTokens,
[src]
T: ToTokens,