pub enum SourceError<'a> {
TemplateWgsl {
uninstantiated_source: &'a Source,
},
TemplateNotFound {
template_name: String,
mangled_type_args: Vec<String>,
available_templates: Vec<String>,
},
AmbiguousTemplate {
template_name: String,
mangled_type_args: Vec<String>,
matching_source_names: Vec<String>,
available_templates: Vec<String>,
},
}Expand description
Errors that Source::wgsl_source can produce.
The lifetime parameter 'a is the borrow of the source that triggered
the error. A template Source is typically a &'static Source (it
lives in static storage, emitted by the macro), so the error is
usually SourceError<'static>. The lifetime parameter is present so
the error can borrow from &self of a non-static source if needed.
Variants§
TemplateWgsl
The source is a template (unresolved module-level type parameters);
the caller must use the macro-emitted instantiate::<…>() to
obtain a concrete crate::ir::Module first, then call
crate::ir::Module::wgsl_source on that.
TemplateNotFound
No candidate source declares a template with the requested name.
This is a configuration error in the source graph (e.g. a missing
wgsl! module import), not a runtime data error.
AmbiguousTemplate
More than one candidate source declares a template with the requested name, so the instantiation is ambiguous. Disambiguate by removing one of the matching sources from the import graph.
Trait Implementations§
Source§impl<'a> Debug for SourceError<'a>
impl<'a> Debug for SourceError<'a>
Source§impl<'a> Display for SourceError<'a>
impl<'a> Display for SourceError<'a>
Source§impl<'a> Error for SourceError<'a>
impl<'a> Error for SourceError<'a>
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()
Source§impl From<SourceError<'_>> for Error
impl From<SourceError<'_>> for Error
Source§fn from(err: SourceError<'_>) -> Self
fn from(err: SourceError<'_>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for SourceError<'a>
impl<'a> RefUnwindSafe for SourceError<'a>
impl<'a> Send for SourceError<'a>
impl<'a> Sync for SourceError<'a>
impl<'a> Unpin for SourceError<'a>
impl<'a> UnsafeUnpin for SourceError<'a>
impl<'a> UnwindSafe for SourceError<'a>
Blanket Implementations§
impl<T> AnySendSync for T
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more