pub struct Printer;Expand description
Printer for the IR.
Implementations§
source§impl Printer
impl Printer
sourcepub fn write_context<F: Write>(
ctx: &Context,
skip_primitives: bool,
f: &mut F
) -> Result<()>
pub fn write_context<F: Write>( ctx: &Context, skip_primitives: bool, f: &mut F ) -> Result<()>
Prints out the program context.
If skip_primitives is true, the printer will skip printing primitives defined outside the source file.
sourcepub fn write_externs<'a, F, I>(
(path, prims): (&Path, I),
f: &mut F
) -> Result<()>where
F: Write,
I: Iterator<Item = &'a Primitive>,
pub fn write_externs<'a, F, I>( (path, prims): (&Path, I), f: &mut F ) -> Result<()>where F: Write, I: Iterator<Item = &'a Primitive>,
Formats and writes extern statements.
pub fn write_primitive<F: Write>( prim: &Primitive, indent: usize, f: &mut F ) -> Result<()>
sourcepub fn write_component<F: Write>(comp: &Component, f: &mut F) -> Result<()>
pub fn write_component<F: Write>(comp: &Component, f: &mut F) -> Result<()>
Formats and writes the Component to the formatter.
sourcepub fn write_cell<F: Write>(
cell: &Cell,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_cell<F: Write>( cell: &Cell, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a cell.
sourcepub fn write_assignment<F: Write, T: Clone + ToString + Eq>(
assign: &Assignment<T>,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_assignment<F: Write, T: Clone + ToString + Eq>( assign: &Assignment<T>, indent_level: usize, f: &mut F ) -> Result<()>
Format and write an assignment.
sourcepub fn assignment_to_str<T>(assign: &Assignment<T>) -> Stringwhere
T: ToString + Clone + Eq,
pub fn assignment_to_str<T>(assign: &Assignment<T>) -> Stringwhere T: ToString + Clone + Eq,
Convinience method to get string representation of ir::Assignment.
sourcepub fn control_to_str(assign: &Control) -> String
pub fn control_to_str(assign: &Control) -> String
Convinience method to get string representation of ir::Control.
sourcepub fn write_comb_group<F: Write>(
group: &CombGroup,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_comb_group<F: Write>( group: &CombGroup, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a combinational group.
sourcepub fn write_group<F: Write>(
group: &Group,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_group<F: Write>( group: &Group, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a group.
sourcepub fn write_static_group<F: Write>(
group: &StaticGroup,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_static_group<F: Write>( group: &StaticGroup, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a static group.
sourcepub fn write_static_control<F: Write>(
scontrol: &StaticControl,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_static_control<F: Write>( scontrol: &StaticControl, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a static control program
sourcepub fn write_control<F: Write>(
control: &Control,
indent_level: usize,
f: &mut F
) -> Result<()>
pub fn write_control<F: Write>( control: &Control, indent_level: usize, f: &mut F ) -> Result<()>
Format and write a control program
sourcepub fn guard_str<T>(guard: &Guard<T>) -> Stringwhere
T: Eq + ToString,
pub fn guard_str<T>(guard: &Guard<T>) -> Stringwhere T: Eq + ToString,
Generate a String-based representation for a guard.
sourcepub fn port_to_str(port: &Port) -> String
pub fn port_to_str(port: &Port) -> String
Get the port access expression.
sourcepub fn format_metadata(metadata: &Option<String>) -> String
pub fn format_metadata(metadata: &Option<String>) -> String
Formats the top-level metadata if present
Auto Trait Implementations§
impl RefUnwindSafe for Printer
impl Send for Printer
impl Sync for Printer
impl Unpin for Printer
impl UnwindSafe for Printer
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