pub enum EmitError {
UnsupportedShape {
type_path: TypePath,
reason: String,
},
UnsupportedSerdeAttr {
type_path: TypePath,
attr: String,
},
UnresolvedReference {
name: String,
referenced_by: TypePath,
},
NameCollision {
name: String,
paths: Vec<TypePath>,
},
}Expand description
Every way emission can fail.
Per the OF-015 design pass these are hard errors only: there is no
FallbackRecord placeholder, no warning-and-continue, no silent untyping.
Either a type emits cleanly or the build fails with one of these.
Errors collect into Vec<EmitError> at the crate::emit boundary so a
single build surfaces every problem rather than first-fails.
Variants§
UnsupportedShape
The type’s Rust shape isn’t in phase-1’s supported subset (tuple
struct, unit struct, runtime-coordination wrapper like Mutex<T>,
user-defined generic, etc.).
UnsupportedSerdeAttr
A #[serde(...)] attribute isn’t supported in phase 1 (e.g.
rename(serialize = "...", deserialize = "..."), or tag/content/
untagged — see OF-015 phase 2), or appears at a level where serde
itself wouldn’t accept it (flatten on a container or variant).
Fields
UnresolvedReference
A referenced ident couldn’t be resolved against the type pool or the external-types table.
Fields
NameCollision
Two reachable types render to the same TS name.
Trait Implementations§
impl Eq for EmitError
Source§impl Error for EmitError
impl Error for EmitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()