Struct llhd::entity::Entity
[−]
[src]
pub struct Entity { /* fields omitted */ }
An entity. Describes through its instructions the data dependencies in order to react to changes in input signals. Implements data flow and timed execution.
Methods
impl Entity
[src]
fn new(name: String, ty: Type) -> Entity
[src]
Create a new entity with the given name and type signature. Anonymous
arguments are created for each input and output in the type signature.
Use the inputs_mut
and outputs_mut
functions get a hold of these
arguments and assign names and additional data to them.
fn as_ref(&self) -> EntityRef
[src]
Obtain a reference to this entity.
fn name(&self) -> &str
[src]
Get the name of the entity.
fn input(&self, idx: usize) -> ArgumentRef
[src]
Get a graph reference to one of the inputs of the entity.
fn inputs(&self) -> &[Argument]
[src]
Get a reference to the input arguments of the entity.
fn inputs_mut(&mut self) -> &mut [Argument]
[src]
Get a mutable reference to the input arguments of the entity.
fn output(&self, idx: usize) -> ArgumentRef
[src]
Get a graph reference to one of the outputs of the entity.
fn outputs(&self) -> &[Argument]
[src]
Get a reference to the output arguments of the entity.
fn outputs_mut(&mut self) -> &mut [Argument]
[src]
Get a mutable reference to the output arguments of the entity.
fn add_inst(&mut self, inst: Inst, pos: InstPosition) -> InstRef
[src]
Add an instruction to the body.
fn move_inst(&mut self, inst: InstRef, pos: InstPosition)
[src]
Move an instruction around within the body.
fn remove_inst(&mut self, inst: InstRef)
[src]
Remove an instruction from the body.
fn inst(&self, inst: InstRef) -> &Inst
[src]
Get a reference to an instruction in the body. Panics if the instruction does not exist.
fn inst_mut(&mut self, inst: InstRef) -> &mut Inst
[src]
Get a mutable reference to an instruction in the body. Panics if the instruction does not exist.
fn insts(&self) -> IndirectMapIter<Iter<InstRef>, Inst>
[src]
Obtain an iterator over the instructions in this entity.
fn inst_refs(&self) -> Iter<InstRef>
[src]
Obtain an iterator over references to the instructions in this entity.
Trait Implementations
impl Value for Entity
[src]
fn id(&self) -> ValueId
[src]
Get the unique ID of the value.
fn ty(&self) -> Type
[src]
Get the type of the value.
fn name(&self) -> Option<&str>
[src]
Get the optional name of the value.
fn is_global(&self) -> bool
[src]
Whether this value is global or not. Global values are considered during linking, and are visible in a module's symbol table. Local values are not, and are only visible within the surrounding context (module or unit). Read more