Skip to main content

AttributeInfo

Enum AttributeInfo 

Source
pub enum AttributeInfo<'a> {
Show 24 variants SourceFile { sourcefile_index: CpIndex, }, InnerClasses { classes: Vec<InnerClass>, }, EnclosingMethod { class_index: CpIndex, method_index: Option<CpIndex>, }, SourceDebugExtension { debug_extension: &'a [u8], }, BootstrapMethods { bootstrap_methods: Vec<BootstrapMethod>, }, ConstantValue { constantvalue_index: CpIndex, }, Code { max_stack: u16, max_locals: u16, code: &'a [u8], exception_table: Vec<ExceptionHandler>, attributes: Vec<AttributeInfo<'a>>, }, Exceptions { exception_index_table: Vec<CpIndex>, }, RuntimeVisibleParameterAnnotations { parameter_annotations: Vec<Vec<Annotation>>, }, RuntimeInvisibleParameterAnnotations { parameter_annotations: Vec<Vec<Annotation>>, }, AnnotationDefault { default_value: ElementValue, }, MethodParameters { parameters: Vec<MethodParameter>, }, Synthetic, Deprecated, Signature { signature_index: CpIndex, }, RuntimeVisibleAnnotations { annotations: Vec<Annotation>, }, RuntimeInvisibleAnnotations { annotations: Vec<Annotation>, }, LineNumberTable { line_number_table: Vec<LineNumber>, }, LocalVariableTable { local_variable_table: Vec<LocalVariable>, }, LocalVariableTypeTable { local_variable_type_table: Vec<LocalVariableType>, }, StackMapTable { entries: Vec<StackMapFrame>, }, RuntimeVisibleTypeAnnotations { annotations: Vec<TypeAnnotation>, }, RuntimeInvisibleTypeAnnotations { annotations: Vec<TypeAnnotation>, }, Unknown { name: String, info: &'a [u8], },
}
Expand description

An attribute of a class, field, method or Code block.

Attributes this crate does not model are kept raw as AttributeInfo::Unknown.

See JVMS §4.7.

Variants§

§

SourceFile

Fields

§sourcefile_index: CpIndex
§

InnerClasses

Fields

§classes: Vec<InnerClass>
§

EnclosingMethod

Fields

§class_index: CpIndex
§method_index: Option<CpIndex>
§

SourceDebugExtension

Fields

§debug_extension: &'a [u8]
§

BootstrapMethods

Fields

§bootstrap_methods: Vec<BootstrapMethod>
§

ConstantValue

Fields

§constantvalue_index: CpIndex
§

Code

Fields

§max_stack: u16
§max_locals: u16
§code: &'a [u8]
§exception_table: Vec<ExceptionHandler>
§attributes: Vec<AttributeInfo<'a>>
§

Exceptions

Fields

§exception_index_table: Vec<CpIndex>
§

RuntimeVisibleParameterAnnotations

Fields

§parameter_annotations: Vec<Vec<Annotation>>
§

RuntimeInvisibleParameterAnnotations

Fields

§parameter_annotations: Vec<Vec<Annotation>>
§

AnnotationDefault

Fields

§default_value: ElementValue
§

MethodParameters

Fields

§parameters: Vec<MethodParameter>
§

Synthetic

§

Deprecated

§

Signature

Fields

§signature_index: CpIndex
§

RuntimeVisibleAnnotations

Fields

§annotations: Vec<Annotation>
§

RuntimeInvisibleAnnotations

Fields

§annotations: Vec<Annotation>
§

LineNumberTable

Fields

§line_number_table: Vec<LineNumber>
§

LocalVariableTable

Fields

§local_variable_table: Vec<LocalVariable>
§

LocalVariableTypeTable

Fields

§local_variable_type_table: Vec<LocalVariableType>
§

StackMapTable

Fields

§

RuntimeVisibleTypeAnnotations

Fields

§annotations: Vec<TypeAnnotation>
§

RuntimeInvisibleTypeAnnotations

Fields

§annotations: Vec<TypeAnnotation>
§

Unknown

Fields

§name: String
§info: &'a [u8]

Implementations§

Source§

impl<'a> AttributeInfo<'a>

Source

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

Reads a u16-prefixed attribute table.

Source

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

Reads one attribute, checking that its body matches the declared length.

Trait Implementations§

Source§

impl<'a> Debug for AttributeInfo<'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 AttributeInfo<'a>

§

impl<'a> RefUnwindSafe for AttributeInfo<'a>

§

impl<'a> Send for AttributeInfo<'a>

§

impl<'a> Sync for AttributeInfo<'a>

§

impl<'a> Unpin for AttributeInfo<'a>

§

impl<'a> UnsafeUnpin for AttributeInfo<'a>

§

impl<'a> UnwindSafe for AttributeInfo<'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.