// Binary format-specific errors
ObjectTooLarge,
InvalidMagic,
InvalidTrailerObjectOffsetSize, // the size of byte offsets to objects in the object table
InvalidTrailerObjectReferenceSize, // the size of indices into the object table
InvalidObjectLength,
ObjectReferenceTooLarge,
ObjectOffsetTooLarge,
RecursiveObject,
NullObjectUnimplemented,
FillObjectUnimplemented,
IntegerOutOfRange,
InfiniteOrNanDate,
InvalidUtf8String,
InvalidUtf16String,
UnknownObjectType(u8),
impl Error { /// Returns true if this error was caused by a failure to read or write bytes on an IO stream. pubfn is_io(&self) -> bool { self.as_io().is_some()
}
/// Returns true if this error was caused by prematurely reaching the end of the input data. pubfn is_eof(&self) -> bool { iflet ErrorKind::UnexpectedEof = self.inner.kind { true
} else { false
}
}
/// Returns the underlying error if it was caused by a failure to read or write bytes on an IO /// stream. pubfn as_io(&self) -> Option<&io::Error> { iflet ErrorKind::Io(err) = &self.inner.kind {
Some(err)
} else {
None
}
}
/// Returns the underlying error if it was caused by a failure to read or write bytes on an IO /// stream or `self` if it was not. pubfn into_io(self) -> Result<io::Error, Self> { iflet ErrorKind::Io(err) = self.inner.kind {
Ok(err)
} else {
Err(self)
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.