pub struct NamedField {
pub name: Ident,
pub attrs: Vec<Attribute>,
pub ty: Type,
/* private fields */
}Fields§
§name: Ident§attrs: Vec<Attribute>§ty: TypeTrait Implementations§
Source§impl Field for NamedField
impl Field for NamedField
Source§fn get_pattern_with_config(
&self,
type_of_self: TypeOfSelf,
name_postfix: &'static str,
) -> TokenStream
fn get_pattern_with_config( &self, type_of_self: TypeOfSelf, name_postfix: &'static str, ) -> TokenStream
Get pattern with configuration for the ownership (with TypeOfSelf and whether to prefix the identifier)
Source§fn get_type_that_needs_constraint(&self) -> Option<Type>
fn get_type_that_needs_constraint(&self) -> Option<Type>
Returns the fields type if it used for the trait (only used internally)
fn get_type(&self) -> &Type
Source§fn get_pattern(&self, type_of_self: TypeOfSelf) -> TokenStream
fn get_pattern(&self, type_of_self: TypeOfSelf) -> TokenStream
Get a pattern for reading this field
Source§impl FieldMut for NamedField
impl FieldMut for NamedField
fn get_reference_with_config( &mut self, used_for_trait: bool, name_postfix: &'static str, ) -> Expr
Source§fn get_reference(&mut self) -> Expr
fn get_reference(&mut self) -> Expr
Get a expression which refers to this field. Note that reference takes the form
_ + index of field, this is
to prevent possible clashes with parameter names.
Use FieldMut::get_reference_with_config to for different optionsSource§impl HasAttributes for NamedField
impl HasAttributes for NamedField
fn get_attributes(&self) -> &[Attribute]
Auto Trait Implementations§
impl !Send for NamedField
impl !Sync for NamedField
impl Freeze for NamedField
impl RefUnwindSafe for NamedField
impl Unpin for NamedField
impl UnsafeUnpin for NamedField
impl UnwindSafe for NamedField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more