Enum Item

Source
pub enum Item {
Show 16 variants UTF8(String), Integer(i32), Float(f32), Long(i64), Double(f64), Class(u16), String(u16), FieldRef { class: u16, name_and_type: u16, }, MethodRef { class: u16, name_and_type: u16, }, InterfaceMethodRef { class: u16, name_and_type: u16, }, NameAndType { name: u16, desc: u16, }, MethodHandle { kind: ReferenceKind, index: u16, }, MethodType(u16), InvokeDynamic { bootstrap_method: u16, name_and_type: u16, }, Module(u16), Package(u16),
}
Expand description

A constant pool item

Variants§

§

UTF8(String)

An UTF-8 encoded string. Inside the class file itself, a modified format is used.

§

Integer(i32)

An int.

§

Float(f32)

A float.

§

Long(i64)

A long. Takes two spots, instead of one.

§

Double(f64)

A double. Takes two spots, instead of one.

§

Class(u16)

An index to the name of the class, or the descriptor of an array type. Always refers to an Item::UTF8(_).

§

String(u16)

A java.lang.String object.

§

FieldRef

Describes a field reference.

Fields

§class: u16

The index to an Item::Class(_). Can be either a Class, or an Interface.

§name_and_type: u16

The index to an Item::NameAndType { .. }.

§

MethodRef

Describes a method reference.

Fields

§class: u16

The index to an Item::Class(_). Must be a Class.

§name_and_type: u16

The index to an Item::NameAndType { .. }.

§

InterfaceMethodRef

Describes a method reference, where the class is an interface.

Fields

§class: u16

The index to an Item::Class(_). Must be an Interface.

§name_and_type: u16

The index to an Item::NameAndType { .. }.

§

NameAndType

Represents a field or method, without indicating which class or type it belongs to.

Fields

§name: u16

The index to an Item::UTF8(_). Must either be a valid unqualfied name or <init>.

§desc: u16

The index to an Item::UTF8(_). Represents a valid field or method descriptor.

§

MethodHandle

Represents a method handle

Fields

§kind: ReferenceKind

Characterizes its bytecode behaviour.

§index: u16

If kind is either GetField, GetStatic, PutField, or PutStatic, the entry at that index must be a Item::FieldRef { .. }. If kind is InvokeVirtual or InvokeSpecial, the entry at that index must be Item::MethodRef { .. }. If kind is InvokeStatic or InvokeSpecial and the version of the class is less than 52.0, the entry at that index must be Item::MethodRef { .. }. If it is 52.0 or above, it must either be a MethodRef or an Item::InterfaceMethodRef { .. }. If kind is InvokeInterface, the entry at that index must be an Item::InterfaceMethodRef { .. }.

§

MethodType(u16)

Describes a method type. The entry at that index must be an Item::UTF8(_) representing a method descriptor.

§

InvokeDynamic

Describes a invoke dynamic instruction, and specifies information regarding the bootstrap method.

Fields

§bootstrap_method: u16

The index to an entry of the BootstrapMethods attribute of the class file.

§name_and_type: u16

The index to an Item::NameAndType { .. }.

§

Module(u16)

Represents a module. The entry at that index must be a Item::UTF8(_) with a valid name. The class must have the MODULE flag set.

§

Package(u16)

Represents a package exported or opened by a module. The entry at that index must be an Item::UTF8(_) with a valid package name encoded in internal form. The class must have the MODULE flag set.

Trait Implementations§

Source§

impl Clone for Item

Source§

fn clone(&self) -> Item

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Item

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Hash for Item

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Item

Source§

fn eq(&self, other: &Item) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Item

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnwindSafe for Item

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.