Enum TracersError

Source
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

Fields

§message: String
§syn_error: Error
§

SynError

Fields

§message: String
§syn_error: Error
§

DarlingError

Fields

§message: String
§darling_error: Arc<Mutex<Error>>
§

InvalidCallExpression

Fields

§message: String
§syn_error: Error
§

OtherError

Fields

§message: String
§error: Error
§

MissingCallInBuildRs

§

BuildInfoReadError

Fields

§message: String
§build_info_path: String
§error: Error
§

BuildInfoWriteError

Fields

§message: String
§build_info_path: String
§error: Error
§

ProviderTraitNotProcessedError

Fields

§message: String
§trait_name: String
§error: Error
§

CodeGenerationError

Fields

§message: String
§

NativeCodeGenerationError

Fields

§message: String
§error: Error

Implementations§

Source§

impl TracersError

Source

pub fn invalid_provider<T: ToTokens>( message: impl AsRef<str>, element: T, ) -> TracersError

Source

pub fn syn_error(message: impl AsRef<str>, e: Error) -> TracersError

Source

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.

Source

pub fn darling_error(e: DarlingError) -> TracersError

Source

pub fn invalid_call_expression<T: ToTokens>( message: impl AsRef<str>, element: T, ) -> TracersError

Source

pub fn other_error<D: Display + Send + Sync + 'static>( e: Context<D>, ) -> TracersError

Source

pub fn missing_call_in_build_rs() -> TracersError

Source

pub fn build_info_read_error(build_info_path: PathBuf, e: Error) -> TracersError

Source

pub fn build_info_write_error( build_info_path: PathBuf, e: Error, ) -> TracersError

Source

pub fn provider_trait_not_processed_error<T: AsRef<str>, E: Into<Error> + Display>( trait_name: T, e: E, ) -> TracersError

Source

pub fn code_generation_error<S: AsRef<str>>(message: S) -> TracersError

Source

pub fn native_code_generation_error<S: AsRef<str>, E: Into<Error> + Display>( message: S, e: E, ) -> TracersError

Source

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

Source

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

Source§

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

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

impl Display for TracersError

Source§

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

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

impl Fail for TracersError

Source§

fn name(&self) -> Option<&str>

Returns the “name” of the error. Read more
Source§

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

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more
Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more
Source§

fn context<D>(self, context: D) -> Context<D>
where D: Display + Send + Sync + 'static, Self: Sized,

Provides context for this failure. Read more
Source§

fn compat(self) -> Compat<Self>
where Self: Sized,

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more
Source§

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

Source§

fn from(failure: Context<D>) -> TracersError

Converts to this type from the input type.
Source§

impl PartialEq for TracersError

Source§

fn eq(&self, other: &TracersError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Send for TracersError

Source§

impl Sync for TracersError

Auto Trait Implementations§

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> AsFail for T
where T: Fail,

Source§

fn as_fail(&self) -> &(dyn Fail + 'static)

Converts a reference to Self into a dynamic trait object of Fail.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V