[][src]Trait genco::lang::LangItem

pub trait LangItem<L> where
    Self: Any,
    L: Lang
{ fn format(
        &self,
        out: &mut Formatter,
        config: &L::Config,
        format: &L::Format
    ) -> Result;
fn __lang_item_as_any(&self) -> &dyn Any;
fn __lang_item_clone(&self) -> Box<dyn LangItem<L>>;
fn __lang_item_eq(&self, other: &dyn LangItem<L>) -> bool; fn as_import(&self) -> Option<&L::Import> { ... } }

A type-erased holder for language-specific items.

Carries formatting and coercion functions like as_import to allow language specific processing to work.

Required methods

fn format(
    &self,
    out: &mut Formatter,
    config: &L::Config,
    format: &L::Format
) -> Result

Format the language item appropriately.

fn __lang_item_as_any(&self) -> &dyn Any

LangItem convert to Any. Automatically implemented by macro.

fn __lang_item_clone(&self) -> Box<dyn LangItem<L>>

LangItem clone. Automatically implemented by macro.

fn __lang_item_eq(&self, other: &dyn LangItem<L>) -> bool

LangItem equality. Automatically implemented by macro.

Loading content...

Provided methods

fn as_import(&self) -> Option<&L::Import>

Coerce into an imported type.

This is used for import resolution for custom language items.

Loading content...

Implementors

impl LangItem<Csharp> for genco::lang::csharp::Import[src]

impl LangItem<Dart> for genco::lang::dart::Import[src]

impl LangItem<Go> for genco::lang::go::Import[src]

impl LangItem<Java> for genco::lang::java::Import[src]

impl LangItem<JavaScript> for genco::lang::js::Import[src]

impl LangItem<JavaScript> for ImportDefault[src]

impl LangItem<Python> for genco::lang::python::Import[src]

impl LangItem<Python> for ImportModule[src]

impl LangItem<Rust> for genco::lang::rust::Import[src]

impl LangItem<Swift> for genco::lang::swift::Import[src]

Loading content...