Skip to main content

ToCells

Trait ToCells 

Source
pub trait ToCells {
    // Required method
    fn to_cells(&self, output: &mut CellStream);

    // Provided method
    fn to_cell_stream(&self, source_id: SourceId) -> CellStream { ... }
}
Expand description

Emits syntax as the linear sequence of cells evaluated at global scope.

This is the global-scope counterpart of ToTokens. Implementations append to an existing stream so independently produced cell fragments compose without intermediate allocation.

Required Methods§

Source

fn to_cells(&self, output: &mut CellStream)

Appends this value’s global cells to output.

Provided Methods§

Source

fn to_cell_stream(&self, source_id: SourceId) -> CellStream

Emits this value into a fresh cell stream with the requested identity.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: ToCells + ?Sized> ToCells for &T

Source§

fn to_cells(&self, output: &mut CellStream)

Source§

impl<T: ToCells + ?Sized> ToCells for Box<T>

Source§

fn to_cells(&self, output: &mut CellStream)

Source§

impl<T: ToCells> ToCells for Option<T>

Source§

fn to_cells(&self, output: &mut CellStream)

Source§

impl<T: ToCells> ToCells for Vec<T>

Source§

fn to_cells(&self, output: &mut CellStream)

Source§

impl<T: ToCells> ToCells for [T]

Source§

fn to_cells(&self, output: &mut CellStream)

Implementors§