pub enum DISError {
InvalidHeader {
reason: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
DeserializationError {
msg: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
SerializationError {
msg: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
InvalidStateTransition {
current_state: PduState,
target_state: PduState,
},
ProtocolVersionMismatch {
expected: ProtocolVersion,
got: ProtocolVersion,
},
InvalidFieldValue {
field: String,
value: String,
reason: String,
},
BufferUnderflow {
attempted: usize,
available: usize,
},
NetworkError(Error),
PduSizeExceeded {
size: usize,
max_size: usize,
},
}Expand description
Enhanced error types for DIS protocol operations
Variants§
InvalidHeader
DeserializationError
SerializationError
InvalidStateTransition
ProtocolVersionMismatch
InvalidFieldValue
BufferUnderflow
NetworkError(Error)
PduSizeExceeded
Implementations§
Source§impl DISError
impl DISError
Sourcepub fn invalid_header<S: Into<String>>(
reason: S,
source: Option<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn invalid_header<S: Into<String>>( reason: S, source: Option<Box<dyn Error + Send + Sync>>, ) -> Self
Create a new InvalidHeader error with optional source error
Sourcepub fn deserialization_error<S: Into<String>>(
msg: S,
source: Option<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn deserialization_error<S: Into<String>>( msg: S, source: Option<Box<dyn Error + Send + Sync>>, ) -> Self
Create a new DeserializationError with optional source error
Sourcepub fn serialization_error<S: Into<String>>(
msg: S,
source: Option<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn serialization_error<S: Into<String>>( msg: S, source: Option<Box<dyn Error + Send + Sync>>, ) -> Self
Create a new SerializationError with optional source error
Sourcepub fn invalid_field<S: Into<String>>(field: S, value: S, reason: S) -> Self
pub fn invalid_field<S: Into<String>>(field: S, value: S, reason: S) -> Self
Create a new InvalidFieldValue error
Sourcepub fn buffer_underflow(attempted: usize, available: usize) -> Self
pub fn buffer_underflow(attempted: usize, available: usize) -> Self
Create a new BufferUnderflow error
Sourcepub const fn pdu_size_exceeded(size: usize, max_size: usize) -> Self
pub const fn pdu_size_exceeded(size: usize, max_size: usize) -> Self
Create a new PduSizeExceeded error
Trait Implementations§
Source§impl Error for DISError
impl Error for DISError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for DISError
impl !RefUnwindSafe for DISError
impl Send for DISError
impl Sync for DISError
impl Unpin for DISError
impl !UnwindSafe for DISError
Blanket Implementations§
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
Mutably borrows from an owned value. Read more