#[non_exhaustive]pub enum Error {
Io(ErrorKind),
Incomplete(Incomplete),
Trailing(TrailingBytes),
InsufficientBuffer(InsufficientBuffer),
InvalidProtocolVersion(u8),
InvalidMessageTypeField(u8),
InvalidReturnCode(u8),
InvalidLength(u32),
UnsupportedMessageID(MessageId),
Sd(Error),
}Expand description
Errors that can occur when encoding, decoding, or validating SOME/IP messages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(ErrorKind)
An I/O error occurred while reading or writing bytes.
Incomplete(Incomplete)
Input ended before the expected number of bytes could be read.
Trailing(TrailingBytes)
Bytes remained after a value that should have consumed the whole buffer.
InsufficientBuffer(InsufficientBuffer)
An output slice was too small for the bytes an encode needed to write.
InvalidProtocolVersion(u8)
The protocol version field contains an unsupported value.
InvalidMessageTypeField(u8)
The message type field contains an unrecognized value.
InvalidReturnCode(u8)
The return code field contains an unrecognized value.
InvalidLength(u32)
The SOME/IP length field was smaller than the 8-byte minimum (request_id..return_code).
UnsupportedMessageID(MessageId)
The message ID is not supported by the payload implementation.
Sd(Error)
A service discovery (SD) error occurred.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<EncodeToSliceError<Error>> for Error
impl From<EncodeToSliceError<Error>> for Error
Source§fn from(e: EncodeToSliceError<Error>) -> Self
fn from(e: EncodeToSliceError<Error>) -> Self
Source§impl From<Error> for Error
Bridges crate::e2e::Error onto protocol::Error so E2E failures can be
reported through the same error type as the rest of the wire path.
impl From<Error> for Error
Bridges crate::e2e::Error onto protocol::Error so E2E failures can be
reported through the same error type as the rest of the wire path.
E2E deliberately does not implement Encode/Decode (see the
src/e2e module docs), so it keeps its own Error type. This impl only
aligns the shape of that error with protocol::Error for callers that
want a single error type to propagate; it does not change E2E’s
protect/check behavior or on-wire bytes.
§Mapping
e2e::Error currently has exactly one variant:
crate::e2e::Error::BufferTooSmall{ needed, actual }→ maps toError::InsufficientBuffer, notError::Incomplete. AlthoughIncomplete { needed, available }has the identical field shape, its semantics are decode-direction (“input ended before enough bytes could be read”).BufferTooSmallinstead means an output slice was too small to hold the bytes E2Eprotectneeded to write — the same direction asautomotive_wire_codec::InsufficientBuffer(“An output slice was too small for the bytes an encode needed to write”). That is the semantically correct counterpart, soneeded/actualmap directly ontoInsufficientBuffer’sneeded/availablefields.