#[non_exhaustive]pub enum Error {
BufferTooSmall {
needed: usize,
actual: usize,
},
}Expand description
Errors that can occur during E2E protection or checking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BufferTooSmall
The output buffer is too small to hold the protected payload.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
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.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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