Struct dicom_core::value::CastValueError [−][src]
Expand description
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 strThe value format requested
got: ValueTypeThe value’s actual representation
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for CastValueError
impl Send for CastValueError
impl Sync for CastValueError
impl Unpin for CastValueError
impl UnwindSafe for CastValueError
Blanket Implementations
For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method receivers. Read more
Mutably borrows from an owned value. Read more