#[non_exhaustive]pub struct ErrorBuffer<T> { /* private fields */ }
Implementations§
Source§impl<T: AsRef<[u8]>> ErrorBuffer<T>
impl<T: AsRef<[u8]>> ErrorBuffer<T>
pub fn new(buffer: T) -> ErrorBuffer<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the packet, returning the underlying buffer.
pub fn new_checked(buffer: T) -> Result<Self, DecodeError>
Sourcepub fn code(&self) -> Option<NonZeroI32>
pub fn code(&self) -> Option<NonZeroI32>
Return the error code.
Returns None
when there is no error to report (the message is an ACK),
or a Some(e)
if there is a non-zero error code e
to report (the
message is a NACK).
Trait Implementations§
Source§impl<T: Clone> Clone for ErrorBuffer<T>
impl<T: Clone> Clone for ErrorBuffer<T>
Source§fn clone(&self) -> ErrorBuffer<T>
fn clone(&self) -> ErrorBuffer<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for ErrorBuffer<T>
impl<T: Debug> Debug for ErrorBuffer<T>
Source§impl<'buffer, T: AsRef<[u8]> + 'buffer> Parseable<ErrorBuffer<&'buffer T>> for ErrorMessage
impl<'buffer, T: AsRef<[u8]> + 'buffer> Parseable<ErrorBuffer<&'buffer T>> for ErrorMessage
type Error = DecodeError
Source§fn parse(buf: &ErrorBuffer<&'buffer T>) -> Result<ErrorMessage, DecodeError>
fn parse(buf: &ErrorBuffer<&'buffer T>) -> Result<ErrorMessage, DecodeError>
Deserialize the current type.
Source§impl<T: PartialEq> PartialEq for ErrorBuffer<T>
impl<T: PartialEq> PartialEq for ErrorBuffer<T>
impl<T: Eq> Eq for ErrorBuffer<T>
impl<T> StructuralPartialEq for ErrorBuffer<T>
Auto Trait Implementations§
impl<T> Freeze for ErrorBuffer<T>where
T: Freeze,
impl<T> RefUnwindSafe for ErrorBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for ErrorBuffer<T>where
T: Send,
impl<T> Sync for ErrorBuffer<T>where
T: Sync,
impl<T> Unpin for ErrorBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for ErrorBuffer<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)