Struct libpulse_binding::mainloop::api::MainloopApi
[−]
[src]
#[repr(C)]pub struct MainloopApi { pub userdata: *mut c_void, pub io_new: Option<extern "C" fn(a: *mut MainloopApi, fd: i32, events: IoEventFlagSet, cb: Option<IoEventCb>, userdata: *mut c_void) -> *mut IoEventInternal>, pub io_enable: Option<extern "C" fn(e: *mut IoEventInternal, events: IoEventFlagSet)>, pub io_free: Option<extern "C" fn(e: *mut IoEventInternal)>, pub io_set_destroy: Option<extern "C" fn(e: *mut IoEventInternal, cb: Option<IoEventDestroyCb>)>, pub time_new: Option<extern "C" fn(a: *mut MainloopApi, tv: *const timeval, cb: Option<TimeEventCb>, userdata: *mut c_void) -> *mut TimeEventInternal>, pub time_restart: Option<extern "C" fn(e: *mut TimeEventInternal, tv: *const timeval)>, pub time_free: Option<extern "C" fn(e: *mut TimeEventInternal)>, pub time_set_destroy: Option<extern "C" fn(e: *mut TimeEventInternal, cb: Option<TimeEventDestroyCb>)>, pub defer_new: Option<extern "C" fn(a: *mut MainloopApi, cb: Option<DeferEventCb>, userdata: *mut c_void) -> *mut DeferEventInternal>, pub defer_enable: Option<extern "C" fn(e: *mut DeferEventInternal, b: i32)>, pub defer_free: Option<extern "C" fn(e: *mut DeferEventInternal)>, pub defer_set_destroy: Option<extern "C" fn(e: *mut DeferEventInternal, cb: Option<DeferEventDestroyCb>)>, pub quit: Option<extern "C" fn(a: *mut MainloopApi, retval: i32)>, }
An abstract mainloop API vtable
Fields
userdata: *mut c_void
A pointer to some private, arbitrary data of the main loop implementation
io_new: Option<extern "C" fn(a: *mut MainloopApi, fd: i32, events: IoEventFlagSet, cb: Option<IoEventCb>, userdata: *mut c_void) -> *mut IoEventInternal>
Create a new IO event source object
io_enable: Option<extern "C" fn(e: *mut IoEventInternal, events: IoEventFlagSet)>
Enable or disable IO events on this object
io_free: Option<extern "C" fn(e: *mut IoEventInternal)>
Free a IO event source object
io_set_destroy: Option<extern "C" fn(e: *mut IoEventInternal, cb: Option<IoEventDestroyCb>)>
Set a function that is called when the IO event source is destroyed. Use this to free the
userdata
argument if required.
time_new: Option<extern "C" fn(a: *mut MainloopApi, tv: *const timeval, cb: Option<TimeEventCb>, userdata: *mut c_void) -> *mut TimeEventInternal>
Create a new timer event source object for the specified Unix time
time_restart: Option<extern "C" fn(e: *mut TimeEventInternal, tv: *const timeval)>
Restart a running or expired timer event source with a new Unix time
time_free: Option<extern "C" fn(e: *mut TimeEventInternal)>
Free a deferred timer event source object
time_set_destroy: Option<extern "C" fn(e: *mut TimeEventInternal, cb: Option<TimeEventDestroyCb>)>
Set a function that is called when the timer event source is destroyed. Use this to free the
userdata
argument if required.
defer_new: Option<extern "C" fn(a: *mut MainloopApi, cb: Option<DeferEventCb>, userdata: *mut c_void) -> *mut DeferEventInternal>
Create a new deferred event source object
defer_enable: Option<extern "C" fn(e: *mut DeferEventInternal, b: i32)>
Enable or disable a deferred event source temporarily
defer_free: Option<extern "C" fn(e: *mut DeferEventInternal)>
Free a deferred event source object
defer_set_destroy: Option<extern "C" fn(e: *mut DeferEventInternal, cb: Option<DeferEventDestroyCb>)>
Set a function that is called when the deferred event source is
destroyed. Use this to free the userdata
argument if required.
quit: Option<extern "C" fn(a: *mut MainloopApi, retval: i32)>
Exit the main loop and return the specified retval
Methods
impl MainloopApi
[src]
pub fn mainloop_api_once(&mut self, cb: (MainloopApiOnceCallback, *mut c_void))
[src]
Run the specified callback function once from the main loop using an anonymous defer event.
If the mainloop runs in a different thread, you need to follow the mainloop implementation's
rules regarding how to safely create defer events. In particular, if you're using
::mainloop::threaded
, you must lock the mainloop before calling
this function.
impl MainloopApi
[src]
pub fn init_signals(&mut self) -> Result<(), i32>
[src]
Initialize the UNIX signal subsystem and bind it to the specified main loop
pub fn signals_done(&self)
[src]
Cleanup the signal subsystem