#[non_exhaustive]pub enum Error {
Show 18 variants
NoOutDir,
Core(Error),
Composition {
schema: PathBuf,
diagnostic: String,
},
NoLibraryName {
schema: PathBuf,
},
Definition {
origin: String,
violation: Violation,
},
TokenEnum {
name: String,
cause: TokenEnumError,
},
UnwritableValue {
schema: String,
field: String,
kind: &'static str,
},
Malformed {
schema: String,
cause: String,
},
DuplicateLibrary {
library: String,
first: PathBuf,
second: PathBuf,
},
ShaderDefs {
path: PathBuf,
cause: String,
},
PlugInfo {
path: PathBuf,
cause: String,
},
UnknownPlugin {
plugin: String,
path: PathBuf,
},
InvalidDeclarationFamily {
family: String,
},
UnknownDeclarationFamily {
family: String,
},
DuplicateKind {
kind: String,
first: String,
second: String,
},
DuplicateMetadataField {
field: String,
first: String,
second: String,
},
MetadataMethodCollision {
library: String,
method: String,
first: String,
second: String,
},
Io {
path: PathBuf,
source: Error,
},
}Expand description
A failure while generating a schema library.
A build script runs this, so a variant that has a file to name names it:
the message is all a contributor sees when cargo build stops.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoOutDir
Generation had schemas to build but nowhere to write them.
Core(Error)
Reading a schema through openusd failed.
Composition
A schema’s layers did not compose, so what it declares cannot be read.
Fields
NoLibraryName
A schema library did not name itself, so nothing can refer to it.
Definition
A schema declares something the generator cannot honour.
Fields
TokenEnum
A configured TokenEnum the schema cannot supply.
Configuration is what asked for it, so this names the enum rather than a layer: nothing in the schema is wrong, and the file to open is the build script.
Fields
cause: TokenEnumErrorWhat it asked for that could not be honoured.
UnwritableValue
A field holds a value the generated declaration has no Rust literal for.
Only a fallback or a piece of metadata reaches the table, so this is a value type nothing generated has needed yet rather than an unusual schema. It stops the build: a fallback that went missing would leave the generated schemas answering differently from the ones they came from.
Fields
Malformed
The generator wrote Rust that does not parse.
A defect in this crate rather than anything a schema can ask for, but it surfaces in a consumer’s build, so it says which schema was being generated and what the parser made of it.
Fields
DuplicateLibrary
Two schemas declare the same libraryName, so both would be written to
one <library>.rs and the second would silently replace the first.
Fields
ShaderDefs
A shader-definition layer does not declare its nodes in a form this crate generates views of.
PlugInfo
A plugInfo.json does not declare its metadata fields or kinds in a
form this crate reads.
UnknownPlugin
A plugInfo.json declares a plugin that is neither a configured
schema’s libraryName nor a requested declaration family, so what it
declares would reach no generated file.
InvalidDeclarationFamily
A declaration family’s name is not an identifier, so it could not name the file generated for it.
UnknownDeclarationFamily
A declaration family was requested for a plugin no configured
plugInfo.json declares.
DuplicateKind
Two libraries declare one kind, so the registry would refuse the second.
Fields
DuplicateMetadataField
Two libraries declare one metadata field, so the registry would refuse the second.
Fields
MetadataMethodCollision
Two of a library’s metadata fields would be read or written by one method of the trait they share.
Fields
Io
A file or directory could not be read, written or created.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<DataError> for Error
A field that will not decode is schema data this crate cannot use. Written
out for the reason above.
impl From<DataError> for Error
A field that will not decode is schema data this crate cannot use. Written out for the reason above.
Source§impl From<EditError> for Error
Authoring the layers this crate writes goes through the same door every
other edit does. Written out for the reason above.
impl From<EditError> for Error
Authoring the layers this crate writes goes through the same door every other edit does. Written out for the reason above.
Source§impl From<PathParseError> for Error
A malformed path names nothing to read.
impl From<PathParseError> for Error
A malformed path names nothing to read.
Written out rather than derived: #[from] builds a conversion into the
variant holding that type, and this belongs in Error::Core with every
other core failure. Its own variant would let one failure arrive two ways —
as itself, or nested in a Core — and leave a caller matching in two
places for it. openusd::Error already tells them apart.
Source§fn from(source: PathParseError) -> Self
fn from(source: PathParseError) -> Self
Source§impl From<QueryError> for Error
A composed query a reader asks of a stage. Written out for the reason
above.
impl From<QueryError> for Error
A composed query a reader asks of a stage. Written out for the reason above.