Skip to main content

ConstantPoolInfo

Enum ConstantPoolInfo 

Source
pub enum ConstantPoolInfo<'a> {
Show 14 variants Utf8 { bytes: Cesu8Bytes<'a>, }, Integer { value: i32, }, Float { value: f32, }, Long { value: i64, }, Double { value: f64, }, Class { name_index: CpIndex, }, String { string_index: CpIndex, }, FieldRef { class_index: CpIndex, name_and_type_index: CpIndex, }, MethodRef { class_index: CpIndex, name_and_type_index: CpIndex, }, InterfaceMethodRef { class_index: CpIndex, name_and_type_index: CpIndex, }, NameAndType { name_index: CpIndex, descriptor_index: CpIndex, }, MethodHandle { reference_kind: ReferenceKind, reference_index: CpIndex, }, MethodType { descriptor_index: CpIndex, }, InvokeDynamic { bootstrap_method_attr_index: u16, name_and_type_index: CpIndex, },
}
Expand description

A single constant pool entry.

See JVMS §4.4.

Variants§

§

Utf8

Fields

§bytes: Cesu8Bytes<'a>
§

Integer

Fields

§value: i32
§

Float

Fields

§value: f32
§

Long

Fields

§value: i64
§

Double

Fields

§value: f64
§

Class

Fields

§name_index: CpIndex
§

String

Fields

§string_index: CpIndex
§

FieldRef

Fields

§class_index: CpIndex
§name_and_type_index: CpIndex
§

MethodRef

Fields

§class_index: CpIndex
§name_and_type_index: CpIndex
§

InterfaceMethodRef

Fields

§class_index: CpIndex
§name_and_type_index: CpIndex
§

NameAndType

Fields

§name_index: CpIndex
§descriptor_index: CpIndex
§

MethodHandle

Fields

§reference_kind: ReferenceKind
§reference_index: CpIndex
§

MethodType

Fields

§descriptor_index: CpIndex
§

InvokeDynamic

Fields

§bootstrap_method_attr_index: u16
§name_and_type_index: CpIndex

Implementations§

Source§

impl<'a> ConstantPoolInfo<'a>

Source

pub fn slot_width(&self) -> u16

Number of pool slots this entry occupies (2 for Long and Double).

Source

pub fn kind(&self) -> &'static str

Name of this entry’s kind, used in error messages.

Trait Implementations§

Source§

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

§

impl<'a> RefUnwindSafe for ConstantPoolInfo<'a>

§

impl<'a> Send for ConstantPoolInfo<'a>

§

impl<'a> Sync for ConstantPoolInfo<'a>

§

impl<'a> Unpin for ConstantPoolInfo<'a>

§

impl<'a> UnsafeUnpin for ConstantPoolInfo<'a>

§

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