Printer

Struct Printer 

Source
pub struct Printer<'writer, W: Write> { /* private fields */ }

Implementations§

Source§

impl<'writer, W: Write> Printer<'writer, W>

Source

pub fn new(writer: &'writer mut W, indent: usize) -> Self

Source

pub fn print_imported_function_alias( &mut self, imported_function_alias: &ImportedFunctionAlias<'_>, ) -> Result

Source

pub fn print_imported_function( &mut self, imported_function: &ImportedFunction<'_>, ) -> Result

Source

pub fn print_import(&mut self, import: &Import<'_>) -> Result

Source

pub fn print_type(&mut self, ty: &Type) -> Result

Source

pub fn print_type_annotation( &mut self, type_annotation: &TypeAnnotation, ) -> Result

Source

pub fn print_label(&mut self, label: &Label<'_>) -> Result

Source

pub fn print_constant_value(&mut self, constant_value: &ConstantValue) -> Result

Source

pub fn print_constant(&mut self, constant: &Constant<'_>) -> Result

Source

pub fn print_value_operation_op( &mut self, value_operation_op: &ValueOperationOp<'_>, ) -> Result

Source

pub fn print_value_operation( &mut self, value_operation: &ValueOperation<'_>, ) -> Result

Source

pub fn print_effect_operation_op( &mut self, effect_operation_op: &EffectOperationOp<'_>, ) -> Result

Source

pub fn print_effect_operation( &mut self, effect_operation: &EffectOperation<'_>, ) -> Result

Source

pub fn print_instruction(&mut self, instruction: &Instruction<'_>) -> Result

Source

pub fn print_function_code(&mut self, code: &FunctionCode<'_>) -> Result

Source

pub fn print_function(&mut self, function: &Function<'_>) -> Result

Source

pub fn print_comment(&mut self, comment: &str) -> Result

Source

pub fn print_newline(&mut self) -> Result

Source

pub fn print_top_level_item(&mut self, item: &TopLevelItem<'_>) -> Result

Source

pub fn print_program(&mut self, program: &Program<'_>) -> Result

Auto Trait Implementations§

§

impl<'writer, W> Freeze for Printer<'writer, W>

§

impl<'writer, W> RefUnwindSafe for Printer<'writer, W>
where W: RefUnwindSafe,

§

impl<'writer, W> Send for Printer<'writer, W>
where W: Send,

§

impl<'writer, W> Sync for Printer<'writer, W>
where W: Sync,

§

impl<'writer, W> Unpin for Printer<'writer, W>

§

impl<'writer, W> !UnwindSafe for Printer<'writer, W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithLocation for T

Source§

fn at(self, spanned: impl Spanned) -> Loc<Self>
where Self: Sized,

Source§

fn between(self, start: impl Spanned, end: impl Spanned) -> Loc<Self>
where Self: Sized,