pub struct GlyphsetWrapper<C: RequestConnection>(/* private fields */);
Expand description
A RAII-like wrapper around a Glyphset.
Instances of this struct represent a Glyphset 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§
Source§impl<C: RequestConnection> GlyphsetWrapper<C>
impl<C: RequestConnection> GlyphsetWrapper<C>
Sourcepub fn for_glyphset(conn: C, id: Glyphset) -> Self
pub fn for_glyphset(conn: C, id: Glyphset) -> Self
Assume ownership of the given resource and destroy it in Drop
.
Sourcepub fn into_glyphset(self) -> Glyphset
pub fn into_glyphset(self) -> Glyphset
Assume ownership of the XID of the wrapped resource
This function destroys this wrapper without freeing the underlying resource.
Source§impl<'c, C: X11Connection> GlyphsetWrapper<&'c C>
impl<'c, C: X11Connection> GlyphsetWrapper<&'c C>
Create a new Glyphset and return a Glyphset wrapper and a cookie.
This is a thin wrapper around create_glyph_set that allocates an id for the Glyphset.
This function returns the resulting GlyphsetWrapper
that owns the created Glyphset and frees
it in Drop
. This also returns a VoidCookie
that comes from the call to
create_glyph_set.
Errors can come from the call to X11Connection::generate_id or create_glyph_set.
Source§impl<C: X11Connection> GlyphsetWrapper<C>
impl<C: X11Connection> GlyphsetWrapper<C>
Sourcepub fn create_glyph_set(
conn: C,
format: Pictformat,
) -> Result<Self, ReplyOrIdError>
pub fn create_glyph_set( conn: C, format: Pictformat, ) -> Result<Self, ReplyOrIdError>
Create a new Glyphset and return a Glyphset wrapper
This is a thin wrapper around create_glyph_set that allocates an id for the Glyphset.
This function returns the resulting GlyphsetWrapper
that owns the created Glyphset and frees
it in Drop
.
Errors can come from the call to X11Connection::generate_id or create_glyph_set.