#[non_exhaustive]pub enum DecodeError {
Custom {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
NotEncapsulated,
FrameRangeOutOfBounds,
MissingAttribute {
name: &'static str,
},
}
Expand description
The possible error conditions when decoding (reading) pixel data.
Users of this type are free to handle errors based on their variant, but should not make decisions based on the display message, since that is not considered part of the API and may change on any new release.
Implementers of transfer syntaxes
are recommended to choose the most fitting error variant
for the tested condition.
When no suitable variant is available,
the Custom
variant may be used.
See also snafu
for guidance on using context selectors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Custom
A custom error occurred when decoding, reported as a dynamic error value with a message.
The whatever!
macro can be used
to easily create an error of this kind.
Fields
NotEncapsulated
The input pixel data is not encapsulated.
Either the image needs no decoding or the compressed imaging data was in a flat pixel data element by mistake.
FrameRangeOutOfBounds
The requested frame range is outside the given object’s frame range.
MissingAttribute
A required attribute is missing from the DICOM object representing the image.
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
Source§impl ErrorCompat for DecodeError
impl ErrorCompat for DecodeError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source
. Read moreSource§impl FromString for DecodeError
impl FromString for DecodeError
Source§impl IntoError<DecodeError> for FrameRangeOutOfBoundsSnafu
impl IntoError<DecodeError> for FrameRangeOutOfBoundsSnafu
Source§fn into_error(self, error: Self::Source) -> DecodeError
fn into_error(self, error: Self::Source) -> DecodeError
Source§impl<__T0> IntoError<DecodeError> for MissingAttributeSnafu<__T0>
impl<__T0> IntoError<DecodeError> for MissingAttributeSnafu<__T0>
Source§fn into_error(self, error: Self::Source) -> DecodeError
fn into_error(self, error: Self::Source) -> DecodeError
Source§impl IntoError<DecodeError> for NotEncapsulatedSnafu
impl IntoError<DecodeError> for NotEncapsulatedSnafu
Source§fn into_error(self, error: Self::Source) -> DecodeError
fn into_error(self, error: Self::Source) -> DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl !RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl !UnwindSafe for DecodeError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more