Struct jbcrs_basic::Pool [] [src]

pub struct Pool { /* fields omitted */ }

The constant pool found in every java class file. It is used to have fast lookup for entries and small files. Removing or modifying items is not allowed to respect already 'used' indices or to prevent rehashing of the underlying HashMap.

A Vec and a HashMap is used internally to have fast lookups by index and value. To connect both, Rcs are used. As a result, we will have a little overhead, but this should be negligible.

Methods

impl Pool
[src]

[src]

[src]

[src]

Returns the encoded length of the pool.

[src]

Returns true if the pool is empty, false otherwise.

[src]

Returns the item at a specified index. If the index is 0 or greater than the size of the pool, an error is returned.

[src]

Returns a cloned String at a specified index.

[src]

Returns a class name at a specified index, but if the utf index is 0, None is returned.

[src]

Returns a class name at a specified index.

[src]

Pushes an item on the pool.

[src]

Pushes an item, which might be a duplicate. This removes the possibility of reading a class, which has multiple constant pool entries, which are the same and then accessing the wrong entry.

[src]

Pushes a new UTF-8 item on the pool and returns an index to it.

[src]

Pushes a new class item on the pool and returns an index to it.

Important traits for PoolIter<'a>
[src]

Trait Implementations

impl Default for Pool
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl !Send for Pool

impl !Sync for Pool