pub enum Control {
Seq(Seq),
Par(Par),
If(If),
While(While),
Invoke(Invoke),
Enable(Enable),
Empty(Empty),
Static(StaticControl),
}
Expand description
Control AST nodes.
Variants§
Seq(Seq)
Represents sequential composition of control statements.
Par(Par)
Represents parallel composition of control statements.
If(If)
Standard imperative if statement
While(While)
Standard imperative while statement
Invoke(Invoke)
Invoke a sub-component with the given port assignments
Enable(Enable)
Runs the control for a list of subcomponents.
Empty(Empty)
Control statement that does nothing.
Static(StaticControl)
Static Control
Implementations§
source§impl Control
impl Control
sourcepub fn static_enable(group: RRC<StaticGroup>) -> Self
pub fn static_enable(group: RRC<StaticGroup>) -> Self
Convience constructor for enable.
sourcepub fn invoke(
comp: RRC<Cell>,
inputs: Vec<(Id, RRC<Port>)>,
outputs: Vec<(Id, RRC<Port>)>
) -> Self
pub fn invoke( comp: RRC<Cell>, inputs: Vec<(Id, RRC<Port>)>, outputs: Vec<(Id, RRC<Port>)> ) -> Self
Convience constructor for invoke.
sourcepub fn if_(
port: RRC<Port>,
cond: Option<RRC<CombGroup>>,
tbranch: Box<Control>,
fbranch: Box<Control>
) -> Self
pub fn if_( port: RRC<Port>, cond: Option<RRC<CombGroup>>, tbranch: Box<Control>, fbranch: Box<Control> ) -> Self
Convience constructor for if
sourcepub fn while_(
port: RRC<Port>,
cond: Option<RRC<CombGroup>>,
body: Box<Control>
) -> Self
pub fn while_( port: RRC<Port>, cond: Option<RRC<CombGroup>>, body: Box<Control> ) -> Self
Convience constructor for while
sourcepub fn get_attribute<A>(&self, attr: A) -> Option<u64>where
A: Into<Attribute>,
pub fn get_attribute<A>(&self, attr: A) -> Option<u64>where A: Into<Attribute>,
Returns the value of an attribute if present
sourcepub fn has_attribute<A>(&self, attr: A) -> boolwhere
A: Into<Attribute>,
pub fn has_attribute<A>(&self, attr: A) -> boolwhere A: Into<Attribute>,
Returns true if the node has a specific attribute
Trait Implementations§
source§impl<'a> From<&'a Control> for GenericControl<'a>
impl<'a> From<&'a Control> for GenericControl<'a>
source§impl From<StaticControl> for Control
impl From<StaticControl> for Control
source§fn from(sc: StaticControl) -> Self
fn from(sc: StaticControl) -> Self
Converts to this type from the input type.
source§impl GetAttributes for Control
impl GetAttributes for Control
source§fn get_mut_attributes(&mut self) -> &mut Attributes
fn get_mut_attributes(&mut self) -> &mut Attributes
Returns a mutable
Attributes
instancesource§fn get_attributes(&self) -> &Attributes
fn get_attributes(&self) -> &Attributes
Returns an
Attributes
instanceAuto Trait Implementations§
impl !RefUnwindSafe for Control
impl !Send for Control
impl !Sync for Control
impl Unpin for Control
impl !UnwindSafe for Control
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