pub struct Field { /* private fields */ }Expand description
A managed field (FieldInfo*).
Implementations§
Source§impl Field
impl Field
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The field’s name as declared, e.g. _health or <Health>k__BackingField.
Sourcepub fn offset(&self) -> usize
pub fn offset(&self) -> usize
The byte offset from the start of an object (for instance fields), with
read_field/write_field.
Sourcepub fn is_static(&self) -> bool
pub fn is_static(&self) -> bool
Whether the field is static, so it lives with the class rather than at
Field::offset in each object.
Sourcepub fn element_type(&self) -> ElementType
pub fn element_type(&self) -> ElementType
The field type’s kind (int, float, class, value type, …), e.g. to
pick the T for Field::read.
Trait Implementations§
impl Copy for Field
impl Send for Field
impl Sync for Field
Auto Trait Implementations§
impl Forget for Field
impl Freeze for Field
impl Move for Field
impl RefUnwindSafe for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe 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