Trait EmitExt

Source
pub trait EmitExt: Emit {
    // Required methods
    fn write_to_stdout(&self, session: &Session) -> Result<()>;
    fn write_to_file(
        &self,
        path: &Path,
        mode: OutputMode,
        session: &Session,
    ) -> Result<()>;
}

Required Methods§

Source

fn write_to_stdout(&self, session: &Session) -> Result<()>

Write this item to standard output, inferring the best OutputMode based on whether or not stdout is a tty or not

Source

fn write_to_file( &self, path: &Path, mode: OutputMode, session: &Session, ) -> Result<()>

Write this item to the given file path, using mode to determine the output type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl EmitExt for Program

Source§

fn write_to_file( &self, path: &Path, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

fn write_to_stdout(&self, session: &Session) -> Result<()>

Implementors§

Source§

impl<T: ?Sized + Emit> EmitExt for T