[][src]Trait genco::Lang

pub trait Lang where
    Self: 'static + Sized
{ type Config; type Format: Default; type Import: ?Sized; fn default_indentation() -> usize { ... }
fn quote_string(out: &mut Formatter, input: &str) -> Result { ... }
fn format_file(
        tokens: &Tokens<Self>,
        out: &mut Formatter,
        config: &Self::Config
    ) -> Result { ... } }

Trait to implement for language specialization.

Associated Types

type Config

Configuration associated with building a formatting element.

type Format: Default

State being used during formatting.

type Import: ?Sized

The type used when resolving imports.

Loading content...

Provided methods

fn default_indentation() -> usize

The default indentation for the current language.

fn quote_string(out: &mut Formatter, input: &str) -> Result

Performing quoting according to convention set by custom element.

fn format_file(
    tokens: &Tokens<Self>,
    out: &mut Formatter,
    config: &Self::Config
) -> Result

Write a file according to convention by custom element.

Loading content...

Implementations on Foreign Types

impl Lang for ()[src]

Dummy implementation for unit.

type Config = ()

type Format = ()

type Import = ()

Loading content...

Implementors

impl Lang for Csharp[src]

type Config = Config

type Format = Format

type Import = dyn TypeTrait

impl Lang for Dart[src]

type Config = Config

type Format = Format

type Import = Type

impl Lang for Go[src]

type Config = Config

type Format = Format

type Import = dyn TypeTrait

impl Lang for Java[src]

type Config = Config

type Format = Format

type Import = dyn TypeTrait

impl Lang for JavaScript[src]

type Config = Config

type Format = Format

type Import = dyn TypeTrait

impl Lang for Python[src]

type Config = Config

type Format = Format

type Import = Type

impl Lang for Rust[src]

type Config = Config

type Format = Format

type Import = Type

impl Lang for Swift[src]

type Config = Config

type Format = Format

type Import = dyn TypeTrait

Loading content...