ConversionErrorKind in rustc_proc_macro - Rust
Description: Errors returned when trying to retrieve a literal unescaped value.

Skip to main content

## ConversionErrorKind

# Enum ConversionErrorKind

Source

    pub enum ConversionErrorKind {
        FailedToUnescape(EscapeError),
        InvalidLiteralKind,
    }

🔬This is a nightly-only experimental API. (`proc_macro_value` #136652)
Expand description

Errors returned when trying to retrieve a literal unescaped value.

## Variants§

§

### FailedToUnescape(EscapeError)

🔬This is a nightly-only experimental API. (`proc_macro_value` #136652)

The literal failed to be escaped, take a look at `EscapeError` for more information.

§

### InvalidLiteralKind

🔬This is a nightly-only experimental API. (`proc_macro_value` #136652)

Trying to convert a literal with the wrong type.

## Trait Implementations§

Source§

### impl Debug for ConversionErrorKind

Source§

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

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

### impl PartialEq for ConversionErrorKind

Source§

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

Tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 (const: unstable) · 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 Eq for ConversionErrorKind

Source§

### impl StructuralPartialEq for ConversionErrorKind

## Auto Trait Implementations§

§

### impl Freeze for ConversionErrorKind

§

### impl RefUnwindSafe for ConversionErrorKind

§

### impl Send for ConversionErrorKind

§

### impl Sync for ConversionErrorKind

§

### impl Unpin for ConversionErrorKind

§

### impl UnsafeUnpin for ConversionErrorKind

§

### impl UnwindSafe for ConversionErrorKind

## 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, 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.

## Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain `repr(...)` attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 1 byte

Size for each variant:

- `FailedToUnescape`: 1 byte
- `InvalidLiteralKind`: 0 bytes