Skip to main content

Error

Enum Error 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§schema: PathBuf

The schema that was being read.

§diagnostic: String

What composition reported. An unresolved sublayer usually wants a search_path.

§

NoLibraryName

A schema library did not name itself, so nothing can refer to it.

Fields

§schema: PathBuf

The schema that was being read.

§

Definition

A schema declares something the generator cannot honour.

Fields

§origin: String

Where the offending declaration lives, layer and path.

§violation: Violation

Which rule it broke.

§

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

§name: String

The enum the configuration asked for.

§cause: TokenEnumError

What 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

§schema: String

The schema declaring it.

§field: String

The field on it.

§kind: &'static str

The value type that has no literal.

§

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

§schema: String

The schema being generated.

§cause: String

What parsing the emitted tokens reported.

§

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

§library: String

The library name they share.

§first: PathBuf

The schema configured first.

§second: PathBuf

The schema configured second.

§

ShaderDefs

A shader-definition layer does not declare its nodes in a form this crate generates views of.

Fields

§path: PathBuf

The layer.

§cause: String

What is wrong with it.

§

PlugInfo

A plugInfo.json does not declare its metadata fields or kinds in a form this crate reads.

Fields

§path: PathBuf

The file.

§cause: String

What is wrong with it.

§

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.

Fields

§plugin: String

The plugin name.

§path: PathBuf

The file declaring it.

§

InvalidDeclarationFamily

A declaration family’s name is not an identifier, so it could not name the file generated for it.

Fields

§family: String

The requested family.

§

UnknownDeclarationFamily

A declaration family was requested for a plugin no configured plugInfo.json declares.

Fields

§family: String

The requested family.

§

DuplicateKind

Two libraries declare one kind, so the registry would refuse the second.

Fields

§kind: String

The kind.

§first: String

The library declaring it first.

§second: String

The library declaring it again.

§

DuplicateMetadataField

Two libraries declare one metadata field, so the registry would refuse the second.

Fields

§field: String

The field.

§first: String

The library declaring it first.

§second: String

The library declaring it again.

§

MetadataMethodCollision

Two of a library’s metadata fields would be read or written by one method of the trait they share.

Fields

§library: String

The library declaring them.

§method: String

The method both need.

§first: String

The field named first.

§second: String

The field named second.

§

Io

A file or directory could not be read, written or created.

Fields

§path: PathBuf

What was being read or written.

§source: Error

What the filesystem reported.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
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.

Source§

fn from(source: DataError) -> Self

Converts to this type from the input type.
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.

Source§

fn from(source: EditError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

impl From<QueryError> for Error

A composed query a reader asks of a stage. Written out for the reason above.

Source§

fn from(source: QueryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.