Skip to main content

StorageCoerceError

Enum StorageCoerceError 

Source
pub enum StorageCoerceError {
    Unsupported {
        from: &'static str,
        to: &'static str,
    },
    OutOfRange {
        from: &'static str,
        to: &'static str,
        index: Option<usize>,
    },
    NonFinite {
        to: &'static str,
        index: Option<usize>,
    },
    PrecisionLoss {
        to: &'static str,
        index: Option<usize>,
    },
    NotIntegral {
        to: &'static str,
        index: Option<usize>,
    },
    MissingValue {
        to: &'static str,
        index: Option<usize>,
    },
    InvalidUtf8 {
        index: Option<usize>,
    },
}
Expand description

Error type for storage-directed conversion failures.

Variants§

§

Unsupported

Conversion between these types is not supported.

Fields

§from: &'static str

Source Rust type name.

§to: &'static str

Target storage type name.

§

OutOfRange

Value is out of range for the target type.

Fields

§from: &'static str

Source Rust type name.

§to: &'static str

Target storage type name.

§index: Option<usize>

Failing element index for vector conversions.

§

NonFinite

Value is non-finite (NaN or Inf) but target requires finite.

Fields

§to: &'static str

Target storage type name.

§index: Option<usize>

Failing element index for vector conversions.

§

PrecisionLoss

Conversion would lose precision.

Fields

§to: &'static str

Target storage type name.

§index: Option<usize>

Failing element index for vector conversions.

§

NotIntegral

Float value is not integral but target is integer type.

Fields

§to: &'static str

Target storage type name.

§index: Option<usize>

Failing element index for vector conversions.

§

MissingValue

Missing value (NA) cannot be represented in target type.

Fields

§to: &'static str

Target storage type name.

§index: Option<usize>

Failing element index for vector conversions.

§

InvalidUtf8

Invalid UTF-8 in string conversion.

Fields

§index: Option<usize>

Failing element index for vector conversions.

Implementations§

Source§

impl StorageCoerceError

Source

pub fn at_index(self, idx: usize) -> Self

Add index information to the error.

Trait Implementations§

Source§

impl Clone for StorageCoerceError

Source§

fn clone(&self) -> StorageCoerceError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StorageCoerceError

Source§

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

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

impl Display for StorageCoerceError

Source§

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

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

impl Error for StorageCoerceError

1.30.0 · 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 PartialEq for StorageCoerceError

Source§

fn eq(&self, other: &StorageCoerceError) -> 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 Eq for StorageCoerceError

Source§

impl StructuralPartialEq for StorageCoerceError

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> RClone for T
where T: Clone,

Source§

fn clone(&self) -> T

Create a deep copy of this value.
Source§

impl<T> RDebug for T
where T: Debug,

Source§

fn debug_str(&self) -> String

Get a compact debug string representation.
Source§

fn debug_str_pretty(&self) -> String

Get a pretty-printed debug string with indentation.
Source§

impl<T> RDisplay for T
where T: Display,

Source§

fn as_r_string(&self) -> String

Convert to a user-friendly string.
Source§

impl<T> RError for T
where T: Error,

Source§

fn error_message(&self) -> String

Get the error message (Display representation).
Source§

fn error_chain(&self) -> Vec<String>

Get all error messages in the chain, from outermost to innermost.
Source§

fn error_chain_length(&self) -> i32

Get the number of errors in the chain.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.