[][src]Struct c2rust_transpile::c_ast::Printer

pub struct Printer<W: Write> { /* fields omitted */ }

Methods

impl<W: Write> Printer<W>[src]

pub fn new(writer: W) -> Printer<W>[src]

pub fn pad(&mut self) -> Result<()>[src]

Assuming the cursor is at the beginning of a line, print out whitespace to reach the indent stored in the Printer.

pub fn newline(&mut self) -> Result<()>[src]

Print out a new line and pad to the right indent stored in the Printer.

pub fn parenthesize<F: FnMut(&mut Self) -> Result<()>>(
    &mut self,
    print_parens: bool,
    action: F
) -> Result<()>
[src]

Pass in an action that will be optionally wrapped in parentheses

pub fn print(&mut self, context: &TypedAstContext) -> Result<()>[src]

pub fn print_expr(
    &mut self,
    expr_id: CExprId,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_expr_prec(
    &mut self,
    _precedence: i32,
    expr_id: CExprId,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_unop(
    &mut self,
    op: &UnOp,
    _context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_binop(
    &mut self,
    op: &BinOp,
    _context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_lit(
    &mut self,
    lit: &CLiteral,
    _context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_stmt(
    &mut self,
    stmt_id: CStmtId,
    newline: bool,
    pad: bool,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_decl(
    &mut self,
    decl_id: CDeclId,
    newline: bool,
    pad: bool,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_decl_name(
    &mut self,
    decl_id: CDeclId,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_type(
    &mut self,
    type_id: CTypeId,
    ident: Option<&str>,
    context: &TypedAstContext
) -> Result<()>
[src]

pub fn print_qtype(
    &mut self,
    type_id: CQualTypeId,
    ident: Option<&str>,
    context: &TypedAstContext
) -> Result<()>
[src]

Auto Trait Implementations

impl<W> Send for Printer<W> where
    W: Send

impl<W> Sync for Printer<W> where
    W: Sync

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
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?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

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

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

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

impl<T> Make for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T