[−][src]Trait genco::lang::Lang
Trait to implement for language specialization.
The various language implementations can be found in the lang module.
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.
Provided methods
fn default_indentation() -> Indentation
Provide the default indentation.
fn open_quote(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
_has_eval: bool
) -> Result
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
_has_eval: bool
) -> Result
Start a string quote.
fn close_quote(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
_has_eval: bool
) -> Result
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
_has_eval: bool
) -> Result
End a string quote.
fn string_eval_literal(
out: &mut Formatter,
config: &Self::Config,
format: &Self::Format,
literal: &str
) -> Result
out: &mut Formatter,
config: &Self::Config,
format: &Self::Format,
literal: &str
) -> Result
A simple, single-literal string evaluation.
fn start_string_eval(
_out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
_out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
Start a string-interpolated eval.
fn end_string_eval(
_out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
_out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
End a string interpolated eval.
fn write_quoted(out: &mut Formatter, input: &str) -> Result
Performing string quoting according to language convention.
fn format_file(
tokens: &Tokens<Self>,
out: &mut Formatter,
config: &Self::Config
) -> Result
tokens: &Tokens<Self>,
out: &mut Formatter,
config: &Self::Config
) -> Result
Write a file according to the specified language convention.
Implementations on Foreign Types
impl Lang for ()
[src]
Loading content...
Implementors
impl Lang for Csharp
[src]
type Config = Config
type Format = Format
type Import = Import
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for Dart
[src]
type Config = Config
type Format = Format
type Import = Import
fn string_eval_literal(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
literal: &str
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
literal: &str
) -> Result
fn start_string_eval(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
Start a string-interpolated eval.
fn end_string_eval(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
End a string interpolated eval.
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for Go
[src]
type Config = Config
type Format = Format
type Import = Import
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for Java
[src]
type Config = Config
type Format = Format
type Import = Import
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for JavaScript
[src]
type Config = Config
type Format = Format
type Import = Import
fn open_quote(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
has_eval: bool
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
has_eval: bool
) -> Result
Start a string quote.
fn close_quote(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
has_eval: bool
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format,
has_eval: bool
) -> Result
End a string quote.
fn start_string_eval(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
fn end_string_eval(
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
[src]
out: &mut Formatter,
_config: &Self::Config,
_format: &Self::Format
) -> Result
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for Python
[src]
type Config = Config
type Format = Format
type Import = dyn AsAny
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
impl Lang for Rust
[src]
type Config = Config
type Format = Format
type Import = Import
fn write_quoted(out: &mut Formatter, input: &str) -> Result
[src]
fn format_file(
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result
[src]
tokens: &Tokens,
out: &mut Formatter,
config: &Self::Config
) -> Result