Trait xcb::ResolveWireError [−][src]
pub trait ResolveWireError {
unsafe fn resolve_wire_error(
first_error: u8,
error: *mut xcb_generic_error_t
) -> Self;
}
Expand description
Trait for the resolution of raw wire error to a unified error enum.
Self
is normally an enum of several event subtypes.
See crate::x::Error and crate::ProtocolError
Required methods
unsafe fn resolve_wire_error(
first_error: u8,
error: *mut xcb_generic_error_t
) -> Self
unsafe fn resolve_wire_error(
first_error: u8,
error: *mut xcb_generic_error_t
) -> Self
Convert a pointer to xcb_generic_error_t
to Self
, inferring the correct subtype
using response_type
field and first_error
.
Panics
Panics if the error subtype cannot be resolved for self
. That is,
response_type
field must be checked beforehand to be in range with
first_error
.
Safety
err
must be a valid, non-null error obtained by xcb_wait_for_reply
or similar function