pub(crate) struct FieldInfo<'a> {
pub accessor: TokenStream,
pub field: &'a Field,
pub index: usize,
}
Fields§
§accessor: TokenStream
§field: &'a Field
§index: usize
Implementations§
source§impl<'a> FieldInfo<'a>
impl<'a> FieldInfo<'a>
pub fn make_list(iter: impl Iterator<Item = &'a Field>) -> Vec<Self>
pub fn new_for_field(f: &'a Field, index: usize) -> Self
sourcepub fn setter(&self) -> TokenStream2
pub fn setter(&self) -> TokenStream2
Get the code for setting this field in struct decl/brace syntax
Use self.accessor for dot-notation accesses
sourcepub fn getter(&self) -> TokenStream2
pub fn getter(&self) -> TokenStream2
Produce a name for a getter for the field
sourcepub fn getter_doc_name(&self) -> String
pub fn getter_doc_name(&self) -> String
Produce a prose name for the field for use in docs
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FieldInfo<'a>
impl<'a> RefUnwindSafe for FieldInfo<'a>
impl<'a> !Send for FieldInfo<'a>
impl<'a> !Sync for FieldInfo<'a>
impl<'a> Unpin for FieldInfo<'a>
impl<'a> UnwindSafe for FieldInfo<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)