pub enum ConstantPoolInfo {
Class {
name_index: constant_pool_index,
},
FieldRef {
class_index: constant_pool_index,
name_and_type_index: constant_pool_index,
},
MethodRef {
class_index: constant_pool_index,
name_and_type_index: constant_pool_index,
},
InterfaceMethodRef {
class_index: constant_pool_index,
name_and_type_index: constant_pool_index,
},
String {
string_index: u2,
},
Integer {
bytes: u4,
},
Float {
bytes: u4,
},
Long {
high_bytes: u4,
low_bytes: u4,
},
Double {
high_bytes: u4,
low_bytes: u4,
},
NameAndType {
name_index: constant_pool_index,
descriptor_index: constant_pool_index,
},
Utf8 {
bytes: Vec<u1>,
},
MethodHandle {
reference: MethodReference,
},
MethodType {
descriptor_index: constant_pool_index,
},
InvokeDynamic {
bootstrap_method_attr_index: constant_pool_index,
name_and_type_index: constant_pool_index,
},
Unusable,
}
Variants
Class | The CONSTANT_Class_info structure
§4.4.1.
Fields
| |
FieldRef | Fields
class_index | | name_and_type_index | |
| |
MethodRef | Fields
class_index | | name_and_type_index | |
| |
InterfaceMethodRef | Fields
class_index | | name_and_type_index | |
| |
String | Fields
| |
Integer | Fields
| |
Float | Fields
| |
Long | Fields
| |
Double | Fields
| |
NameAndType | Fields
name_index | | descriptor_index | |
| |
Utf8 | Fields
| |
MethodHandle | Fields
| |
MethodType | Fields
| |
InvokeDynamic | Fields
bootstrap_method_attr_index | A valid index into the bootstrap_methods array of the bootstrap method table.
| name_and_type_index | A valid index into the constant_pool table. The constant_pool entry at that index
must be a valid ConstantPoolInfo::Utf8 structure representing the name of the
attribute.
|
| |
Unusable | Indicates an unusable constant pool entry.
All 8-byte constants take up two entries in the constant_pool table of the class file. If a
CONSTANT_Long_info or CONSTANT_Double_info structure is the item in the constant_pool
table at index n, then the next usable item in the pool is located at index n + 2. The
constant_pool index n + 1 must be valid but is considered unusable.
| |
Methods
Trait Implementations
Derived Implementations