pub struct Field { /* private fields */ }Expand description
A field of a struct, with generics applied.
Implementations§
Source§impl Field
impl Field
pub fn get_proto(self) -> Reader<'static>
pub fn get_type(&self) -> Type
pub fn get_index(&self) -> u16
pub fn get_annotations(self) -> Result<AnnotationList>
Sourcepub fn get_newtype_ids(&self) -> &'static [u64]
pub fn get_newtype_ids(&self) -> &'static [u64]
The ids of the type newtypes this field was declared with, nearest
first, or empty if it wasn’t declared with one.
With type Point = Vec3; and type ChainedPoint = Point;, a field
declared corner :ChainedPoint gives the ids of ChainedPoint,
Point and Vec3, in that order. Each newtype’s generated module
has its id as TYPE_ID, so ids.contains(&vec3::TYPE_ID) asks “is
this field a Vec3, under whatever alias?”.
The field’s type (get_type) is unchanged by this: a group newtype
is still a struct, and a scalar newtype its underlying type. For a
list, this describes the list field itself, not its elements.
Trait Implementations§
impl Copy for Field
impl Eq for Field
Auto Trait Implementations§
impl !RefUnwindSafe for Field
impl !Send for Field
impl !Sync for Field
impl !UnwindSafe for Field
impl Freeze for Field
impl Unpin for Field
impl UnsafeUnpin for Field
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