#[non_exhaustive]pub struct ReadFailure {
pub error: ModelError,
pub bytes: Vec<u8>,
}Expand description
A refused read, with the input it refused handed back.
try_read_owned takes the buffer; on failure the caller gets it back
uncopied, so it can locate the error in it or read it again under another
policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.error: ModelErrorWhy the read failed.
bytes: Vec<u8>The input, as it was passed in.
Implementations§
Source§impl ReadFailure
impl ReadFailure
Sourcepub fn location(&self) -> Option<SyntaxLocation>
pub fn location(&self) -> Option<SyntaxLocation>
Where in ReadFailure::bytes the error is, for a syntax error.
Trait Implementations§
Source§impl Clone for ReadFailure
impl Clone for ReadFailure
Source§fn clone(&self) -> ReadFailure
fn clone(&self) -> ReadFailure
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReadFailure
impl Debug for ReadFailure
Source§impl Display for ReadFailure
impl Display for ReadFailure
Source§impl Error for ReadFailure
impl Error for ReadFailure
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<ReadFailure> for ModelError
impl From<ReadFailure> for ModelError
Source§fn from(failure: ReadFailure) -> Self
fn from(failure: ReadFailure) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ReadFailure
impl RefUnwindSafe for ReadFailure
impl Send for ReadFailure
impl Sync for ReadFailure
impl Unpin for ReadFailure
impl UnsafeUnpin for ReadFailure
impl UnwindSafe for ReadFailure
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