[][src]Trait stir::blocks::BasicBlock

pub trait BasicBlock {
    fn label(&self) -> &String;
fn debug(&self);
fn output(&self) -> String;
fn interpret(&self) -> bool; fn is_critical(&self) -> bool { ... } }

Required methods

fn label(&self) -> &String

Return the unique label of the block

fn debug(&self)

Allows run-time inspection of the block

Example

use stir::blocks::{Boolean, BasicBlock};

let b = Boolean::new(false);

b.debug(); // Also usable in the `fry` interpreter

fn output(&self) -> String

Transforms the block into its corresponding STIR representation

fn interpret(&self) -> bool

Interpret and execute a block

Example

use stir::blocks::{Boolean, BasicBlock};

let b = Boolean::new(true);

assert!(b.interpret());
Loading content...

Provided methods

fn is_critical(&self) -> bool

If the block is critical or if it can safely be parallelized

Example

use stir::blocks::{Boolean, Critical, BasicBlock};

let non_crit_b = Boolean::new(false);

let critical_boolean_block = Boolean::new(true);
let critical_b = Critical::new(&critical_boolean_block);

assert!(critical_b.is_critical());
assert!(!non_crit_b.is_critical());
Loading content...

Trait Implementations

impl Debug for dyn BasicBlock[src]

Implementors

impl BasicBlock for Boolean[src]

impl<'_> BasicBlock for Critical<'_>[src]

impl<'_> BasicBlock for IfElse<'_>[src]

impl<'_> BasicBlock for Loop<'_>[src]

Loading content...