Struct x11rb::protocol::xproto::FontWrapper
source · pub struct FontWrapper<C: RequestConnection>(/* private fields */);
Expand description
A RAII-like wrapper around a Font.
Instances of this struct represent a Font 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> FontWrapper<C>
impl<C: RequestConnection> FontWrapper<C>
source§impl<'c, C: X11Connection> FontWrapper<&'c C>
impl<'c, C: X11Connection> FontWrapper<&'c C>
Create a new Font and return a Font wrapper and a cookie.
This is a thin wrapper around open_font that allocates an id for the Font.
This function returns the resulting FontWrapper
that owns the created Font and frees
it in Drop
. This also returns a VoidCookie
that comes from the call to
open_font.
Errors can come from the call to X11Connection::generate_id or open_font.
source§impl<C: X11Connection> FontWrapper<C>
impl<C: X11Connection> FontWrapper<C>
sourcepub fn open_font(conn: C, name: &[u8]) -> Result<Self, ReplyOrIdError>
pub fn open_font(conn: C, name: &[u8]) -> Result<Self, ReplyOrIdError>
Create a new Font and return a Font wrapper
This is a thin wrapper around open_font that allocates an id for the Font.
This function returns the resulting FontWrapper
that owns the created Font and frees
it in Drop
.
Errors can come from the call to X11Connection::generate_id or open_font.