Trait Emit

Source
pub trait Emit {
    // Required methods
    fn name(&self) -> Option<Symbol>;
    fn output_type(&self, mode: OutputMode) -> OutputType;
    fn write_to<W: Writer>(
        &self,
        writer: W,
        mode: OutputMode,
        session: &Session,
    ) -> Result<()>;
}

Required Methods§

Source

fn name(&self) -> Option<Symbol>

The name of this item, if applicable

Source

fn output_type(&self, mode: OutputMode) -> OutputType

The output type associated with this item and the given mode

Source

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Write this item to the given std::io::Write handle, 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 Emit for MastArtifact

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

impl Emit for Module

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, _mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, _session: &Session, ) -> Result<()>

Source§

impl Emit for Library

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, _session: &Session, ) -> Result<()>

Source§

impl Emit for Program

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, _session: &Session, ) -> Result<()>

Source§

impl Emit for Package

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

impl<T: Emit> Emit for &T

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

impl<T: Emit> Emit for &mut T

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

impl<T: Emit> Emit for Box<T>

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Source§

impl<T: Emit> Emit for Arc<T>

Source§

fn name(&self) -> Option<Symbol>

Source§

fn output_type(&self, mode: OutputMode) -> OutputType

Source§

fn write_to<W: Writer>( &self, writer: W, mode: OutputMode, session: &Session, ) -> Result<()>

Implementors§