#[non_exhaustive]#[repr(C)]pub struct Field {
pub name: &'static str,
pub shape: fn() -> &'static Shape,
pub offset: usize,
pub flags: FieldFlags,
pub attributes: &'static [FieldAttribute],
pub doc: &'static [&'static str],
}Expand description
Describes a field in a struct or tuple
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'static strkey for the struct field (for tuples and tuple-structs, this is the 0-based index)
shape: fn() -> &'static Shapeshape of the inner type
offset: usizeoffset of the field in the struct (obtained through core::mem::offset_of)
flags: FieldFlagsflags for the field (e.g. sensitive, etc.)
attributes: &'static [FieldAttribute]arbitrary attributes set via the derive macro
doc: &'static [&'static str]doc comments
Implementations§
Trait Implementations§
impl Copy for Field
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin 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