[][src]Struct cranelift_codegen_meta::cdsl::ast::ConstPool

pub(crate) struct ConstPool {
    pool: Vec<Vec<u8>>,
}

Contains constants created in the AST that must be inserted into the true ConstantPool when the legalizer code is generated. The constant data is named in the order it is inserted; inserting data using insert will avoid duplicates.

Fields

pool: Vec<Vec<u8>>

Methods

impl ConstPool[src]

pub fn new() -> Self[src]

Create an empty constant pool.

fn create_name(position: usize) -> String[src]

Create a name for a constant from its position in the pool.

pub fn insert(&mut self, data: Vec<u8>) -> String[src]

Insert constant data into the pool, returning the name of the variable used to reference it. This method will search for data that matches the new data and return the existing constant name to avoid duplicates.

pub fn iter(&self) -> impl Iterator<Item = (String, &Vec<u8>)>[src]

Iterate over the name/value pairs in the pool.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.