Struct x11rb::protocol::xproto::GcontextWrapper [−][src]
pub struct GcontextWrapper<'c, C: RequestConnection>(_, _);
Expand description
A RAII-like wrapper around a Gcontext.
Instances of this struct represent a Gcontext that is freed in Drop
.
Any errors during Drop
are silently ignored. Most likely an error here means that your
X11 connection is broken and later requests will also fail.
Implementations
Assume ownership of the given resource and destroy it in Drop
.
Assume ownership of the XID of the wrapped resource
This function destroys this wrapper without freeing the underlying resource.
Create a new Gcontext and return a Gcontext wrapper and a cookie.
This is a thin wrapper around create_gc that allocates an id for the Gcontext.
This function returns the resulting GcontextWrapper
that owns the created Gcontext and frees
it in Drop
. This also returns a VoidCookie
that comes from the call to
create_gc.
Errors can come from the call to X11Connection::generate_id or create_gc.
pub fn create_gc(
conn: &'c C,
drawable: Drawable,
value_list: &CreateGCAux
) -> Result<Self, ReplyOrIdError>
pub fn create_gc(
conn: &'c C,
drawable: Drawable,
value_list: &CreateGCAux
) -> Result<Self, ReplyOrIdError>
Create a new Gcontext and return a Gcontext wrapper
This is a thin wrapper around create_gc that allocates an id for the Gcontext.
This function returns the resulting GcontextWrapper
that owns the created Gcontext and frees
it in Drop
.
Errors can come from the call to X11Connection::generate_id or create_gc.
Trait Implementations
Performs the conversion.