Struct dicom_core::value::CastValueError
source · [−]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 str
The value format requested
got: ValueType
The value’s actual representation
Trait Implementations
sourceimpl Clone for CastValueError
impl Clone for CastValueError
sourcefn clone(&self) -> CastValueError
fn clone(&self) -> CastValueError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CastValueError
impl Debug for CastValueError
sourceimpl Display for CastValueError
impl Display for CastValueError
sourceimpl Error for CastValueError
impl Error for CastValueError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl PartialEq<CastValueError> for CastValueError
impl PartialEq<CastValueError> for CastValueError
sourcefn eq(&self, other: &CastValueError) -> bool
fn eq(&self, other: &CastValueError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CastValueError) -> bool
fn ne(&self, other: &CastValueError) -> bool
This method tests for !=
.
impl StructuralPartialEq for CastValueError
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
sourceimpl<T> AsErrorSource for T where
T: 'static + Error,
impl<T> AsErrorSource for T where
T: 'static + Error,
sourcefn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method receivers. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more