[−][src]Struct msgpack_simple::ParseError
An error that occurred while parsing a binary as MsgPack
Fields
byte: usize
The byte where the error was found
Implementations
impl ParseError
[src]
pub fn offset(&self, value: usize) -> ParseError
[src]
Creates another error of the same type with a byte offset
use msgpack_simple::ParseError; let error = ParseError { byte: 5 }; let other = error.offset(3); assert_eq!(other.byte, 8);
pub fn offset_result<T>(
result: Result<T, ParseError>,
value: usize
) -> Result<T, ParseError>
[src]
result: Result<T, ParseError>,
value: usize
) -> Result<T, ParseError>
Takes a result with ParseError as its error type and returns the same with a byte offset on the error
use msgpack_simple::ParseError; let result: Result<(), ParseError> = Err(ParseError { byte: 39 }); let other = ParseError::offset_result(result, 3); let error = other.unwrap_err(); assert_eq!(error.byte, 42);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,