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§
Sourcefn type_name(cfg: &ExportConfig) -> String
fn type_name(cfg: &ExportConfig) -> String
Type name (may include generic parameters).
Provided Methods§
Sourcefn type_ident(cfg: &ExportConfig) -> String
fn type_ident(cfg: &ExportConfig) -> String
Identifier without generic parameters.
Sourcefn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
Output file path (relative to export dir), without extension.
Sourcefn visit_dependencies(_: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(_: &mut impl TypeVisitor)where
Self: 'static,
Visit all direct dependencies.
Sourcefn visit_generics(_: &mut impl TypeVisitor)where
Self: 'static,
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.