pub struct ConstantPool { /* private fields */ }
Expand description

Maintains the mapping between a constant handle (i.e. Constant) and its constant data (i.e. ConstantData).

Implementations

Create a new constant pool instance.

Empty the constant pool of all data.

Insert constant data into the pool, returning a handle for later referencing; when constant data is inserted that is a duplicate of previous constant data, the existing handle will be returned.

Retrieve the constant data given a handle.

Link a constant handle to its value. This does not de-duplicate data but does avoid replacing any existing constant values. use set to tie a specific const42 to its value; use insert to add a value and return the next available const entity.

Iterate over the constants in insertion order.

Iterate over mutable entries in the constant pool in insertion order.

Return the number of constants in the pool.

Return the combined size of all of the constant values in the pool.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.