[][src]Struct dicom_core::value::CastValueError

pub struct CastValueError {
    pub requested: &'static str,
    pub got: ValueType,
}

An error type for an attempt of accessing a value in one internal representation as another.

This error is raised whenever it is not possible to retrieve the requested value, either because the inner representation is not compatible with the requested value type, or a conversion would be required. In other words, if a reference to the inner value cannot be obtained with the requested target type (for example, retrieving a date from a string), an error of this type is returned.

If such a conversion is acceptable, please use conversion methods instead: to_date instead of date, to_str instead of string, and so on. The error type would then be ConvertValueError.

Fields

requested: &'static str

The value format requested

got: ValueType

The value's actual representation

Trait Implementations

impl Clone for CastValueError[src]

impl Debug for CastValueError[src]

impl Display for CastValueError[src]

impl Error for CastValueError[src]

impl PartialEq<CastValueError> for CastValueError[src]

impl StructuralPartialEq for CastValueError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsErrorSource for T where
    T: 'static + Error
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.