Enum x11rb::rust_connection::ParseError
source · #[non_exhaustive]pub enum ParseError {
InsufficientData,
ConversionFailed,
InvalidExpression,
InvalidValue,
MissingFileDescriptors,
}
Expand description
An error occurred while parsing some data
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InsufficientData
Not enough data was provided.
ConversionFailed
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
.
InvalidExpression
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.
InvalidValue
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
.
MissingFileDescriptors
Some file descriptors were expected, but not enough were received.
Trait Implementations§
source§impl Clone for ParseError
impl Clone for ParseError
source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
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 Debug for ParseError
impl Debug for ParseError
source§impl Display for ParseError
impl Display for ParseError
source§impl Error for ParseError
impl Error for ParseError
1.30.0 · 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<ParseError> for ConnectError
impl From<ParseError> for ConnectError
source§fn from(err: ParseError) -> ConnectError
fn from(err: ParseError) -> ConnectError
Converts to this type from the input type.
source§impl From<ParseError> for ConnectionError
impl From<ParseError> for ConnectionError
source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
source§impl From<ParseError> for ReplyError
impl From<ParseError> for ReplyError
source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
source§impl From<ParseError> for ReplyOrIdError
impl From<ParseError> for ReplyOrIdError
source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
source§impl PartialEq for ParseError
impl PartialEq for ParseError
impl Copy for ParseError
impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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
)