pub struct FSMGenPass {
pub fsm_cnt: usize,
pub step_cnt: usize,
pub seq_cnt: usize,
pub par_cnt: usize,
pub branch_cnt: usize,
pub for_cnt: usize,
pub pipeline_cnt: usize,
pub cur_module_name: String,
pub cfs: Vec<(Vec<InstRule>, Vec<InstRule>)>,
pub gen_modules: Vec<Module>,
pub top_fsms: Vec<String>,
}Fields§
§fsm_cnt: usize§step_cnt: usize§seq_cnt: usize§par_cnt: usize§branch_cnt: usize§for_cnt: usize§pipeline_cnt: usize§cur_module_name: String§cfs: Vec<(Vec<InstRule>, Vec<InstRule>)>§gen_modules: Vec<Module>§top_fsms: Vec<String>Implementations§
Source§impl FSMGenPass
impl FSMGenPass
pub fn new() -> Self
pub fn visit_step(&mut self, step: &BodyOp) -> FSMRet
pub fn visit_seq(&mut self, seq: &BodyOp) -> FSMRet
pub fn visit_par(&mut self, par: &ParOp) -> FSMRet
pub fn visit_branch(&mut self, branch: &BranchOp) -> FSMRet
pub fn visit_for(&mut self, for_op: &ForOp) -> FSMRet
pub fn visit_pipeline(&mut self, ops: &Vec<Op>) -> FSMRet
pub fn visit_op(&mut self, op: &Op) -> FSMRet
pub fn gen_rules( &mut self, fsm: FSMRet, data: &mut VisitorData<'_>, fsm_rule: Rule, ) -> Vec<Rule>
Trait Implementations§
Source§impl Visitor for FSMGenPass
impl Visitor for FSMGenPass
fn name() -> &'static str
fn before_visit_rules(&mut self, data: &mut VisitorData<'_>) -> Result<()>
fn visit_rule_impl( &mut self, data: &mut VisitorData<'_>, ) -> Result<(Vec<Rule>, Vec<RuleRel>), Error>
fn after_visit_rules(&mut self, data: &mut VisitorData<'_>) -> Result<()>
fn after_pass(&mut self, circuit: &mut Circuit) -> Result<()>
fn filter_item<'a, T>( items: impl Iterator<Item = T>, filter_fn: impl Fn(&T) -> bool, ) -> Vec<T>
fn filter_op<'a>( ops: impl Iterator<Item = &'a Op>, filter_fn: impl Fn(&Op) -> bool, ) -> Vec<&'a Op>
fn flatten_op<'a>(op: &'a Op) -> Vec<&'a Op>
fn flatten_ops<'a>(ops: impl Iterator<Item = &'a Op>) -> Vec<&'a Op>
fn filter_map<'a, T: Clone + 'a, P>( items: impl Iterator<Item = &'a T>, filter_fn: impl Fn(&T) -> Option<P>, ) -> (Vec<P>, HashMap<usize, usize>)
fn dump_results(&self, data: &mut VisitorData<'_>)
fn visit_op_impl( &mut self, op: &mut Op, data: &mut VisitorData<'_>, ) -> Result<(), Error>
fn visit_op( &mut self, op: &mut Op, data: &mut VisitorData<'_>, ) -> Result<(), Error>
fn visit_rule_prelog( &mut self, rule: &Rule, data: &mut VisitorData<'_>, ) -> Result<(), Error>
fn visit_rule_guard(&mut self, data: &mut VisitorData<'_>) -> Result<(), Error>
fn visit_rule( &mut self, rule: Rule, data: &mut VisitorData<'_>, ) -> Result<(Vec<Rule>, Vec<RuleRel>), Error>
fn topo_sort_rules<'a, T: Clone + Debug>( rules: impl Iterator<Item = &'a Rule> + Clone, f: impl Fn(usize, &'a Rule) -> (String, T), ) -> Vec<T>
Source§fn get_rules_in_topo_order(&mut self, data: &mut VisitorData<'_>) -> Vec<Rule>
fn get_rules_in_topo_order(&mut self, data: &mut VisitorData<'_>) -> Vec<Rule>
fn get_rules_in_order(&mut self, data: &mut VisitorData<'_>) -> Vec<Rule>
fn infer_rule_relations( &mut self, data: &mut VisitorData<'_>, ) -> Result<(), Error>
fn prepare_visit_module_impl( &mut self, data: &mut VisitorData<'_>, ) -> Result<(), Error>
fn prepare_visit_module(&mut self, data: VisitorData<'_>) -> Result<(), Error>
fn visit_module(&mut self, data: VisitorData<'_>) -> Result<(), Error>
fn pass_prelog(&mut self, circuit: &mut Circuit) -> Result<(), Error>
fn visit_function( &mut self, function: &mut Function, circuit: &mut Circuit, ) -> Result<(), Error>
fn after_visit_modules(&mut self, circuit: &mut Circuit) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for FSMGenPass
impl RefUnwindSafe for FSMGenPass
impl Send for FSMGenPass
impl Sync for FSMGenPass
impl Unpin for FSMGenPass
impl UnwindSafe for FSMGenPass
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self with the
fg()
set to
Color::BrightBlack.
§Example
println!("{}", value.bright_black());Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self with the
fg()
set to
Color::BrightGreen.
§Example
println!("{}", value.bright_green());Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self with the
fg()
set to
Color::BrightYellow.
§Example
println!("{}", value.bright_yellow());Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self with the
fg()
set to
Color::BrightMagenta.
§Example
println!("{}", value.bright_magenta());Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self with the
fg()
set to
Color::BrightWhite.
§Example
println!("{}", value.bright_white());Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightBlack.
§Example
println!("{}", value.on_bright_black());Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightGreen.
§Example
println!("{}", value.on_bright_green());Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightYellow.
§Example
println!("{}", value.on_bright_yellow());Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightBlue.
§Example
println!("{}", value.on_bright_blue());Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightMagenta.
§Example
println!("{}", value.on_bright_magenta());Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightCyan.
§Example
println!("{}", value.on_bright_cyan());Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self with the
bg()
set to
Color::BrightWhite.
§Example
println!("{}", value.on_bright_white());Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self with the
attr()
set to
Attribute::Underline.
§Example
println!("{}", value.underline());Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self with the
attr()
set to
Attribute::RapidBlink.
§Example
println!("{}", value.rapid_blink());Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);