pub enum TracersError {
InvalidProvider {
message: String,
syn_error: Error,
},
SynError {
message: String,
syn_error: Error,
},
DarlingError {
message: String,
darling_error: Arc<Mutex<Error>>,
},
InvalidCallExpression {
message: String,
syn_error: Error,
},
OtherError {
message: String,
error: Error,
},
MissingCallInBuildRs,
BuildInfoReadError {
message: String,
build_info_path: String,
error: Error,
},
BuildInfoWriteError {
message: String,
build_info_path: String,
error: Error,
},
ProviderTraitNotProcessedError {
message: String,
trait_name: String,
error: Error,
},
CodeGenerationError {
message: String,
},
NativeCodeGenerationError {
message: String,
error: Error,
},
}
Variants§
InvalidProvider
SynError
DarlingError
InvalidCallExpression
OtherError
MissingCallInBuildRs
BuildInfoReadError
BuildInfoWriteError
ProviderTraitNotProcessedError
CodeGenerationError
NativeCodeGenerationError
Implementations§
Source§impl TracersError
impl TracersError
pub fn invalid_provider<T: ToTokens>( message: impl AsRef<str>, element: T, ) -> TracersError
pub fn syn_error(message: impl AsRef<str>, e: Error) -> TracersError
Sourcepub fn syn_like_error<T: ToTokens, U: Display>(
message: U,
tokens: T,
) -> TracersError
pub fn syn_like_error<T: ToTokens, U: Display>( message: U, tokens: T, ) -> TracersError
When we need to raise an error that is attached to a syn
type (meaning the span of the
error will correctly be associated with that type), this method is used. There is no
actual syn
error, we’re just reporting a logic error of our own while processing some
syn
types.
pub fn darling_error(e: DarlingError) -> TracersError
pub fn invalid_call_expression<T: ToTokens>( message: impl AsRef<str>, element: T, ) -> TracersError
pub fn other_error<D: Display + Send + Sync + 'static>( e: Context<D>, ) -> TracersError
pub fn missing_call_in_build_rs() -> TracersError
pub fn build_info_read_error(build_info_path: PathBuf, e: Error) -> TracersError
pub fn build_info_write_error( build_info_path: PathBuf, e: Error, ) -> TracersError
pub fn provider_trait_not_processed_error<T: AsRef<str>, E: Into<Error> + Display>( trait_name: T, e: E, ) -> TracersError
pub fn code_generation_error<S: AsRef<str>>(message: S) -> TracersError
pub fn native_code_generation_error<S: AsRef<str>, E: Into<Error> + Display>( message: S, e: E, ) -> TracersError
Sourcepub fn into_syn_error(self) -> Error
pub fn into_syn_error(self) -> Error
Converts this error type into a syn::Error
, preserving context from spans and elements if
any were given
Sourcepub fn into_compiler_error(self) -> TokenStream
pub fn into_compiler_error(self) -> TokenStream
Convert this error into a TokenStream
such that when the compiler consumes the token
stream it will evaluate to a compile error, with the span corresponding to whatever element
was used to report the error. For those error types that don’t have a corresponding
element, the call site of the macro will be used
Trait Implementations§
Source§impl Debug for TracersError
impl Debug for TracersError
Source§impl Display for TracersError
impl Display for TracersError
Source§impl Fail for TracersError
impl Fail for TracersError
Source§fn cause(&self) -> Option<&dyn Fail>
fn cause(&self) -> Option<&dyn Fail>
Source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read moreSource§impl<D: Display + Send + Sync + 'static> From<Context<D>> for TracersError
Implement conversion from regular errors into a TracersError, but only if the error has been
given a context message using the .context()
extension method provided by failure
impl<D: Display + Send + Sync + 'static> From<Context<D>> for TracersError
Implement conversion from regular errors into a TracersError, but only if the error has been
given a context message using the .context()
extension method provided by failure