Skip to main content

FieldInfo

Struct FieldInfo 

Source
pub struct FieldInfo<'a> {
    pub access_flags: FieldAccessFlags,
    pub name_index: CpIndex,
    pub descriptor_index: CpIndex,
    pub attributes: Vec<AttributeInfo<'a>>,
}
Expand description

A single field of a class.

See JVMS §4.5.

Fields§

§access_flags: FieldAccessFlags§name_index: CpIndex§descriptor_index: CpIndex§attributes: Vec<AttributeInfo<'a>>

Implementations§

Source§

impl<'a> FieldInfo<'a>

Source

pub fn try_read( constant_pool: &ConstantPool<'a>, cursor: &mut Cursor<'a>, ) -> Result<Self>

Reads one field, validating its constant pool references.

Source

pub fn signature( &self, constant_pool: &ConstantPool<'a>, ) -> Result<Option<Cow<'a, str>>>

Returns the generic signature from the Signature attribute, if present.

Source

pub fn name(&self, constant_pool: &ConstantPool<'a>) -> Result<Cow<'a, str>>

Returns the field name.

Source

pub fn descriptor( &self, constant_pool: &ConstantPool<'a>, ) -> Result<Cow<'a, str>>

Returns the field type descriptor.

Trait Implementations§

Source§

impl<'a> Debug for FieldInfo<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> UnsafeUnpin for FieldInfo<'a>

§

impl<'a> UnwindSafe for FieldInfo<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.