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
InnerClasses
Fields
§
classes: Vec<InnerClass>EnclosingMethod
SourceDebugExtension
BootstrapMethods
Fields
§
bootstrap_methods: Vec<BootstrapMethod>ConstantValue
Code
Exceptions
RuntimeVisibleParameterAnnotations
Fields
§
parameter_annotations: Vec<Vec<Annotation>>RuntimeInvisibleParameterAnnotations
Fields
§
parameter_annotations: Vec<Vec<Annotation>>AnnotationDefault
Fields
§
default_value: ElementValueMethodParameters
Fields
§
parameters: Vec<MethodParameter>Synthetic
Deprecated
Signature
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
§
entries: Vec<StackMapFrame>RuntimeVisibleTypeAnnotations
Fields
§
annotations: Vec<TypeAnnotation>RuntimeInvisibleTypeAnnotations
Fields
§
annotations: Vec<TypeAnnotation>Unknown
Implementations§
Source§impl<'a> AttributeInfo<'a>
impl<'a> AttributeInfo<'a>
Sourcepub fn try_read_all(
constant_pool: &ConstantPool<'a>,
cursor: &mut Cursor<'a>,
) -> Result<Vec<Self>>
pub fn try_read_all( constant_pool: &ConstantPool<'a>, cursor: &mut Cursor<'a>, ) -> Result<Vec<Self>>
Reads a u16-prefixed attribute table.
Sourcepub fn try_read(
constant_pool: &ConstantPool<'a>,
cursor: &mut Cursor<'a>,
) -> Result<Self>
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§
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> 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