Skip to main content

Format

Trait Format 

Source
pub trait Format<PrefixWs, Args>: Formattable {
    // Required method
    fn format(
        &mut self,
        ctx: &mut Context<'_>,
        prefix_ws: PrefixWs,
        args: Args,
    ) -> FormatOutput;
}
Expand description

Type formatting

Required Methods§

Source

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args, ) -> FormatOutput

Formats this 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 Format<(), ()> for ()

Source§

fn format( &mut self, _ctx: &mut Context<'_>, _prefix_ws: (), _args: (), ) -> FormatOutput

Source§

impl Format<(), ()> for Whitespace

Source§

fn format( &mut self, _ctx: &mut Context<'_>, _prefix_ws: (), _args: (), ) -> FormatOutput

Source§

impl Format<WhitespaceConfig, ()> for Whitespace

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, _args: (), ) -> FormatOutput

Source§

impl<PrefixWs, Args> Format<PrefixWs, Args> for !

Source§

fn format( &mut self, _ctx: &mut Context<'_>, _prefix_ws: PrefixWs, _args: Args, ) -> FormatOutput

Source§

impl<T0: Format<WhitespaceConfig, ()>> Format<WhitespaceConfig, ()> for (T0,)

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, args: (), ) -> FormatOutput

Source§

impl<T0: Format<WhitespaceConfig, ()>, T1: Format<WhitespaceConfig, ()>> Format<WhitespaceConfig, ()> for (T0, T1)

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, args: (), ) -> FormatOutput

Source§

impl<T0: Format<WhitespaceConfig, ()>, T1: Format<WhitespaceConfig, ()>, T2: Format<WhitespaceConfig, ()>> Format<WhitespaceConfig, ()> for (T0, T1, T2)

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, args: (), ) -> FormatOutput

Source§

impl<T> Format<(), ()> for PhantomData<T>

Source§

fn format( &mut self, _ctx: &mut Context<'_>, _prefix_ws: (), _args: (), ) -> FormatOutput

Source§

impl<T, PrefixWs, A> Format<PrefixWs, Args<PrefixWs, A>> for Vec<T>
where T: Format<PrefixWs, A>, PrefixWs: Clone, A: Clone,

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args<PrefixWs, A>, ) -> FormatOutput

Source§

impl<T: ArenaData + Format<PrefixWs, Args>, PrefixWs, Args> Format<PrefixWs, Args> for ArenaIdx<T>

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args, ) -> FormatOutput

Source§

impl<T: Format<PrefixWs, Args>, PrefixWs, Args> Format<PrefixWs, Args> for Option<T>

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args, ) -> FormatOutput

Source§

impl<T: Format<PrefixWs, Args>, PrefixWs, Args> Format<PrefixWs, Args> for &mut T

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args, ) -> FormatOutput

Source§

impl<T: Format<PrefixWs, Args>, PrefixWs, Args> Format<PrefixWs, Args> for Box<T>

Source§

fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: PrefixWs, args: Args, ) -> FormatOutput

Implementors§