pub struct ConstantPool { /* private fields */ }Expand description
An index-preserving constant pool whose slots()[index] is the physical JVM slot.
Implementations§
Source§impl ConstantPool
impl ConstantPool
Sourcepub fn decode(
reader: &mut ByteReader<'_>,
major_version: u16,
) -> Result<Self, ConstantPoolError>
pub fn decode( reader: &mut ByteReader<'_>, major_version: u16, ) -> Result<Self, ConstantPoolError>
Decode the constant_pool_count and all following entries for major_version.
Sourcepub fn slots(&self) -> &[ConstantSlot]
pub fn slots(&self) -> &[ConstantSlot]
Borrow every physical slot. Index zero and two-slot holes remain explicit.
Sourcepub fn entry(
&self,
source_index: u16,
target_index: u16,
) -> Result<&Constant, ConstantPoolError>
pub fn entry( &self, source_index: u16, target_index: u16, ) -> Result<&Constant, ConstantPoolError>
Return a usable entry or a typed located target error.
Sourcepub fn validate(&self, major_version: u16) -> Result<(), ConstantPoolError>
pub fn validate(&self, major_version: u16) -> Result<(), ConstantPoolError>
Validate layout, version bounds, reference indices, and target categories.
Sourcepub fn encode(
&self,
writer: &mut ByteWriter,
major_version: u16,
) -> Result<(), ConstantPoolError>
pub fn encode( &self, writer: &mut ByteWriter, major_version: u16, ) -> Result<(), ConstantPoolError>
Encode the count and entries after revalidating the pool.
Trait Implementations§
Source§impl Clone for ConstantPool
impl Clone for ConstantPool
Source§fn clone(&self) -> ConstantPool
fn clone(&self) -> ConstantPool
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstantPool
impl Debug for ConstantPool
Source§impl PartialEq for ConstantPool
impl PartialEq for ConstantPool
impl StructuralPartialEq for ConstantPool
Auto Trait Implementations§
impl Freeze for ConstantPool
impl RefUnwindSafe for ConstantPool
impl Send for ConstantPool
impl Sync for ConstantPool
impl Unpin for ConstantPool
impl UnsafeUnpin for ConstantPool
impl UnwindSafe for ConstantPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more