#[non_exhaustive]pub enum TokenEnumError {
Show 14 variants
MalformedSource {
spelling: String,
},
UnknownClass {
class: String,
},
UnknownProperty {
class: String,
property: String,
},
NoAllowedTokens {
class: String,
property: String,
},
NoFallback {
class: String,
property: String,
},
UnknownFallback {
token: String,
},
UnnameableToken {
token: String,
},
VariantCollision {
first: String,
second: String,
variant: String,
},
InvalidName,
ReservedName,
UnknownLibrary {
library: String,
},
InvalidVariant {
token: String,
variant: String,
},
UnknownVariantToken {
token: String,
},
Duplicate,
}Expand description
What a configured TokenEnum asked for that could not
be honoured.
Every one of these is a configuration mistake rather than a schema one, and each stops generation: an enum silently left out, or one quietly given a variant name nobody chose, is worse than a build that stops and says which.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MalformedSource
A source not spelled Class.property.
UnknownClass
A class the library does not declare.
UnknownProperty
A property the class does not declare.
NoAllowedTokens
A source property declaring no allowedTokens, so there are no variants
to generate.
NoFallback
A default asked for from a property with no token fallback to take it from.
UnknownFallback
A default asked for from a fallback the allowed tokens do not admit.
UnnameableToken
A token no casing rule turns into a Rust name — an empty spelling, one opening with a digit, one that is punctuation alone.
VariantCollision
Two tokens reaching one variant name. Suffixing one of them would put a name nobody chose into a public API, so the caller is asked instead.
Fields
InvalidName
A type name the caller spelled that Rust would not take.
ReservedName
A type name the generated file already uses for something else.
UnknownLibrary
A library neither generated by this run nor declared with
extern_library, which is a name
nothing will ever match.
InvalidVariant
A variant name the caller spelled that Rust would not take.
UnknownVariantToken
A variant override for a token the source property does not admit, which is a name that would silently do nothing.
Duplicate
Two enums of one library under one name.
Trait Implementations§
Source§impl Debug for TokenEnumError
impl Debug for TokenEnumError
Source§impl Display for TokenEnumError
impl Display for TokenEnumError
Source§impl Error for TokenEnumError
impl Error for TokenEnumError
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()