Trait xcb::BaseError [−][src]
pub trait BaseError {
const EXTENSION: Option<Extension>;
const NUMBER: u32;
unsafe fn from_raw(raw: *mut xcb_generic_error_t) -> Self;
unsafe fn into_raw(self) -> *mut xcb_generic_error_t;
fn as_raw(&self) -> *mut xcb_generic_error_t;
fn as_slice(&self) -> &[u8]ⓘ;
}
Expand description
A trait to designate base protocol errors.
The base errors follow the usual resolution idiom of error_code
offset.
This should be completely transparent to the user, as ProtocolError is resolving all types of errors together.
Associated Constants
The extension associated to this error, or None
for the main protocol
Required methods
unsafe fn from_raw(raw: *mut xcb_generic_error_t) -> Self
unsafe fn from_raw(raw: *mut xcb_generic_error_t) -> Self
Build an error from a raw pointer
Safety
raw
must be a valid pointer to the error, and be allocated with libc::malloc
unsafe fn into_raw(self) -> *mut xcb_generic_error_t
unsafe fn into_raw(self) -> *mut xcb_generic_error_t
Convert the error into a raw pointer
Safety
returned value should be freed with libc::free
to avoid memory leak, or used to build a new error
fn as_raw(&self) -> *mut xcb_generic_error_t
fn as_raw(&self) -> *mut xcb_generic_error_t
Obtain the error as a raw pointer