Skip to main content

ElementValue

Enum ElementValue 

Source
pub enum ElementValue {
    Constant {
        tag: u8,
        constant_index: u16,
        origin: AttributeOrigin,
    },
    Enum {
        type_name_index: u16,
        constant_name_index: u16,
        origin: AttributeOrigin,
    },
    Class {
        class_info_index: u16,
        origin: AttributeOrigin,
    },
    Annotation {
        annotation: Box<Annotation>,
        origin: AttributeOrigin,
    },
    Array {
        values: Vec<ElementValue>,
        origin: AttributeOrigin,
    },
}
Expand description

A JVM annotation element_value, with every constant-pool index left unresolved.

Variants§

§

Constant

Primitive or string constant (B, C, D, F, I, J, S, Z, or s).

Fields

§tag: u8

Exact element-value tag.

§constant_index: u16

Constant-pool index of the value.

§origin: AttributeOrigin

Source range of the complete value.

§

Enum

Enum constant (e).

Fields

§type_name_index: u16

Constant-pool index of the enum type name.

§constant_name_index: u16

Constant-pool index of the enum constant name.

§origin: AttributeOrigin

Source range of the complete value.

§

Class

Class literal (c).

Fields

§class_info_index: u16

Constant-pool index of the return descriptor.

§origin: AttributeOrigin

Source range of the complete value.

§

Annotation

Nested annotation (@).

Fields

§annotation: Box<Annotation>

Nested annotation value.

§origin: AttributeOrigin

Source range including the tag.

§

Array

Ordered annotation array ([).

Fields

§values: Vec<ElementValue>

Values in encoded order.

§origin: AttributeOrigin

Source range of the complete array.

Implementations§

Source§

impl ElementValue

Source

pub fn origin(&self) -> AttributeOrigin

Source range occupied by this value.

Trait Implementations§

Source§

impl Clone for ElementValue

Source§

fn clone(&self) -> ElementValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementValue

Source§

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

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

impl Eq for ElementValue

Source§

impl PartialEq for ElementValue

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ElementValue

Auto Trait Implementations§

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.