pub struct AlarmWrapper<C: RequestConnection>(/* private fields */);
Expand description
A RAII-like wrapper around a Alarm.
Instances of this struct represent a Alarm 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> AlarmWrapper<C>
impl<C: RequestConnection> AlarmWrapper<C>
Source§impl<'c, C: X11Connection> AlarmWrapper<&'c C>
impl<'c, C: X11Connection> AlarmWrapper<&'c C>
Create a new Alarm and return a Alarm wrapper and a cookie.
This is a thin wrapper around create_alarm that allocates an id for the Alarm.
This function returns the resulting AlarmWrapper
that owns the created Alarm and frees
it in Drop
. This also returns a VoidCookie
that comes from the call to
create_alarm.
Errors can come from the call to X11Connection::generate_id or create_alarm.
Source§impl<C: X11Connection> AlarmWrapper<C>
impl<C: X11Connection> AlarmWrapper<C>
Sourcepub fn create_alarm(
conn: C,
value_list: &CreateAlarmAux,
) -> Result<Self, ReplyOrIdError>
pub fn create_alarm( conn: C, value_list: &CreateAlarmAux, ) -> Result<Self, ReplyOrIdError>
Create a new Alarm and return a Alarm wrapper
This is a thin wrapper around create_alarm that allocates an id for the Alarm.
This function returns the resulting AlarmWrapper
that owns the created Alarm and frees
it in Drop
.
Errors can come from the call to X11Connection::generate_id or create_alarm.