pub enum DcmError {
Show 21 variants
Io(Error),
UnexpectedEof {
offset: u64,
},
InvalidFile {
reason: String,
},
InvalidTag {
group: u16,
element: u16,
reason: String,
},
VrMismatch {
group: u16,
element: u16,
expected: String,
found: String,
},
InvalidValue {
group: u16,
element: u16,
reason: String,
},
InvalidLength {
group: u16,
element: u16,
length: u64,
},
UnsupportedTransferSyntax {
uid: String,
},
NoCodec {
uid: String,
},
UnknownTag {
group: u16,
element: u16,
},
InvalidUid {
reason: String,
},
CharsetError {
reason: String,
},
AssociationRejected {
reason: String,
},
AssociationAborted {
abort_source: String,
reason: String,
},
DimseError {
status: u16,
description: String,
},
Timeout {
seconds: u64,
},
NoPresentationContext {
sop_class_uid: String,
},
TlsError {
reason: String,
},
DecompressionError {
reason: String,
},
CompressionError {
reason: String,
},
Other(String),
}Expand description
Central error type for all dcmtk-rs operations.
Mirrors the module+code+text structure of DCMTK’s OFCondition but uses
Rust’s enum-based error handling for exhaustive matching.
Variants§
Io(Error)
Wraps a std::io::Error.
UnexpectedEof
Unexpected end of data while parsing.
InvalidFile
The DICOM preamble or prefix (“DICM”) is invalid.
InvalidTag
A tag could not be interpreted.
VrMismatch
Value representation mismatch.
InvalidValue
A value could not be decoded from the underlying bytes.
InvalidLength
An element has an invalid or unsupported length.
UnsupportedTransferSyntax
The transfer syntax UID is not recognized or not supported.
NoCodec
No codec is registered for a compressed transfer syntax.
UnknownTag
A tag was not found in the data dictionary.
InvalidUid
A UID string is syntactically invalid.
CharsetError
Character set conversion failed.
AssociationRejected
DICOM association was rejected by the remote peer.
AssociationAborted
DICOM association was aborted.
DimseError
A DIMSE operation failed with a status code.
Timeout
Network timeout.
NoPresentationContext
Presentation context negotiation failed.
TlsError
TLS handshake or transport error.
DecompressionError
Image decompression failed.
CompressionError
Image compression failed.
Other(String)
Catch-all for errors that don’t fit other variants.
Trait Implementations§
Source§impl Error for DcmError
impl Error for DcmError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()