pub struct AirFunction {
pub id: FunctionId,
pub name: String,
pub params: Vec<AirParam>,
pub blocks: Vec<AirBlock>,
pub entry_block: Option<BlockId>,
pub is_declaration: bool,
pub span: Option<Span>,
pub symbol: Option<Symbol>,
pub block_index: BTreeMap<BlockId, usize>,
}Expand description
An AIR function.
Fields§
§id: FunctionIdUnique function identifier.
name: StringFunction name.
params: Vec<AirParam>Function parameters.
blocks: Vec<AirBlock>Basic blocks (first is entry block unless entry_block is specified).
entry_block: Option<BlockId>Entry block ID (defaults to first block if not specified).
is_declaration: boolWhether this function is a declaration (no body).
span: Option<Span>Optional source location.
symbol: Option<Symbol>Optional symbol information.
block_index: BTreeMap<BlockId, usize>Pre-computed index: BlockId -> position in blocks vec.
Skipped during serialization; rebuilt on deserialization.
Implementations§
Source§impl AirFunction
impl AirFunction
Sourcepub fn new(id: FunctionId, name: impl Into<String>) -> Self
pub fn new(id: FunctionId, name: impl Into<String>) -> Self
Create a new function.
Sourcepub fn rebuild_block_index(&mut self)
pub fn rebuild_block_index(&mut self)
Rebuild the block_index from the current blocks vec.
Call this after bulk-modifying blocks directly (e.g., assigning
a whole Vec<AirBlock>). Not needed when using add_block.
Trait Implementations§
Source§impl Clone for AirFunction
impl Clone for AirFunction
Source§fn clone(&self) -> AirFunction
fn clone(&self) -> AirFunction
Returns a duplicate of the value. Read more
1.0.0 · 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 AirFunction
impl Debug for AirFunction
Source§impl<'de> Deserialize<'de> for AirFunction
impl<'de> Deserialize<'de> for AirFunction
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AirFunction
impl PartialEq for AirFunction
Auto Trait Implementations§
impl Freeze for AirFunction
impl RefUnwindSafe for AirFunction
impl Send for AirFunction
impl Sync for AirFunction
impl Unpin for AirFunction
impl UnsafeUnpin for AirFunction
impl UnwindSafe for AirFunction
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