[][src]Struct llhd::Entity

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]

pub fn new(
    name: impl Into<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.

pub fn as_ref(&self) -> EntityRef
[src]

Obtain a reference to this entity.

pub fn name(&self) -> &str
[src]

Get the name of the entity.

pub fn input(&self, idx: usize) -> ArgumentRef
[src]

Get a graph reference to one of the inputs of the entity.

pub fn inputs(&self) -> &[Argument]
[src]

Get a reference to the input arguments of the entity.

pub fn inputs_mut(&mut self) -> &mut [Argument]
[src]

Get a mutable reference to the input arguments of the entity.

pub fn output(&self, idx: usize) -> ArgumentRef
[src]

Get a graph reference to one of the outputs of the entity.

pub fn outputs(&self) -> &[Argument]
[src]

Get a reference to the output arguments of the entity.

pub fn outputs_mut(&mut self) -> &mut [Argument]
[src]

Get a mutable reference to the output arguments of the entity.

pub fn add_inst(&mut self, inst: Inst, pos: InstPosition) -> InstRef
[src]

Add an instruction to the body.

pub fn move_inst(&mut self, inst: InstRef, pos: InstPosition)
[src]

Move an instruction around within the body.

pub fn remove_inst(&mut self, inst: InstRef)
[src]

Remove an instruction from the body.

pub fn inst(&self, inst: InstRef) -> &Inst
[src]

Get a reference to an instruction in the body. Panics if the instruction does not exist.

pub 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.

Important traits for IndirectMapIter<'tf, T, V>
pub fn insts(&self) -> IndirectMapIter<Iter<InstRef>, Inst>
[src]

Obtain an iterator over the instructions in this entity.

pub 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]

Auto Trait Implementations

impl Send for Entity

impl Sync for Entity

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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