Skip to main content

ExportableType

Trait ExportableType 

Source
pub trait ExportableType {
    // Required method
    fn type_name(cfg: &ExportConfig) -> String;

    // Provided methods
    fn type_ident(cfg: &ExportConfig) -> String { ... }
    fn output_path() -> Option<PathBuf> { ... }
    fn visit_dependencies(_: &mut impl TypeVisitor)
       where Self: 'static { ... }
    fn visit_generics(_: &mut impl TypeVisitor)
       where Self: 'static { ... }
}
Expand description

Core trait that all exportable types implement.

This is the type-system-agnostic base. Language-specific traits (Flow’s Flow, ts-rs’s TS) extend this with syntax-specific methods.

Required Methods§

Source

fn type_name(cfg: &ExportConfig) -> String

Type name (may include generic parameters).

Provided Methods§

Source

fn type_ident(cfg: &ExportConfig) -> String

Identifier without generic parameters.

Source

fn output_path() -> Option<PathBuf>

Output file path (relative to export dir), without extension.

Source

fn visit_dependencies(_: &mut impl TypeVisitor)
where Self: 'static,

Visit all direct dependencies.

Source

fn visit_generics(_: &mut impl TypeVisitor)
where Self: 'static,

Visit all generic type parameters.

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.

Implementors§