Skip to main content

ValueMissing

Enum ValueMissing 

Source
#[non_exhaustive]
pub enum ValueMissing { UnsetScalar { data_type: DataType, }, UnsetCollection { data_type: DataType, }, EmptyCollection { data_type: DataType, }, EmptyCollectionConversion { to: DataType, }, Conversion { from: DataType, to: DataType, }, CollectionItem { source_index: usize, from: DataType, to: DataType, }, }
Expand description

Describes the typed state that produced a missing-value error.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UnsetScalar

A scalar was unset with a declared data type.

Fields

§data_type: DataType

Type retained by the unset scalar storage.

§

UnsetCollection

A collection was unset with a declared element type.

Fields

§data_type: DataType

Element type retained by the unset collection storage.

§

EmptyCollection

A concrete collection contains no item for a first-item read.

Fields

§data_type: DataType

Element type of the concrete empty collection.

§

EmptyCollectionConversion

A conversion requested one item from an empty collection.

The source collection has no item and therefore no source value type can be recovered from the shared conversion error. to records the requested target type instead of overloading EmptyCollection.

Fields

§to: DataType

Requested target data type.

§

Conversion

A conversion policy treated a concrete scalar as missing.

Fields

§from: DataType

Declared source data type.

§to: DataType

Requested target data type.

§

CollectionItem

A collection item conversion produced no value.

Fields

§source_index: usize

Original zero-based source position.

§from: DataType

Declared source data type.

§to: DataType

Requested target data type.

Implementations§

Source§

impl ValueMissing

Source

pub const fn source_type(self) -> Option<DataType>

Returns the source or declared data type associated with the error.

Returns None for Self::EmptyCollectionConversion because no source item exists for that conversion.

Source

pub const fn target_type(self) -> Option<DataType>

Returns the requested target type for conversion failures.

Source

pub const fn source_index(self) -> Option<usize>

Returns the source index for a missing collection item.

Source

pub const fn is_unset(self) -> bool

Reports whether storage itself is unset.

Source

pub const fn is_empty_collection(self) -> bool

Reports whether a concrete collection is empty.

Source

pub const fn is_conversion(self) -> bool

Reports whether the missing value came from a conversion.

Trait Implementations§

Source§

impl Clone for ValueMissing

Source§

fn clone(&self) -> ValueMissing

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for ValueMissing

Source§

impl Debug for ValueMissing

Source§

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

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

impl Display for ValueMissing

Source§

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

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

impl Eq for ValueMissing

Source§

impl Hash for ValueMissing

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ValueMissing

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ValueMissing

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> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value. Read more
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.