Enum x11rb::errors::ParseError [−][src]
An error occurred while parsing some data
Variants (Non-exhaustive)
Not enough data was provided.
A value did not fit.
This error can e.g. happen when a value that was received from the X11 server does not fit
into an usize
.
The value of an expression could not be computed.
As an example, the length of the data in xproto
’s GetPropertyReply
is described by
value_len * (format / 8)
. The multiplication could cause an overflow, which would be
represented by this error.
A value was outside of its valid range.
There are two kinds of situations where this error can happen:
- The protocol was violated and a nonsensical value was found.
- The user of the API called the wrong parsing function.
Examples for the first kind of error:
- One of a set of values should be present (a
<switch>
in xcb-proto-speak), but none of the<cases>
matched. This can e.g. happen when parsingcrate::protocol::xinput::InputInfo
. - Parsing a request with a length field that is too small for the request header to fit.
Examples for the second kind of error:
- Parsing an X11 error with
response_type != 0
. - Parsing an X11 reply with
response_type != 1
. - Parsing an X11 request with the wrong value for its
minor_opcode
.
Some file descriptors were expected, but not enough were received.
Trait Implementations
impl Clone for ParseError
[src]
fn clone(&self) -> ParseError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ParseError
[src]
impl Debug for ParseError
[src]
impl Display for ParseError
[src]
impl Eq for ParseError
[src]
impl Error for ParseError
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<ParseError> for ConnectError
[src]
fn from(err: ParseError) -> Self
[src]
impl From<ParseError> for ConnectionError
[src]
fn from(err: ParseError) -> Self
[src]
impl From<ParseError> for ReplyError
[src]
fn from(err: ParseError) -> Self
[src]
impl From<ParseError> for ReplyOrIdError
[src]
fn from(err: ParseError) -> Self
[src]
impl PartialEq<ParseError> for ParseError
[src]
fn eq(&self, other: &ParseError) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for ParseError
[src]
impl StructuralPartialEq for ParseError
[src]
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,