#[repr(C)]
pub struct MainloopApi {
Show 14 fields pub userdata: *mut c_void, pub io_new: Option<extern "C" fn(a: *const 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: *const 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: *const 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: *const MainloopApi, retval: RetvalActual)>,
}
Expand description

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: *const MainloopApi, fd: i32, events: IoEventFlagSet, cb: Option<IoEventCb>, userdata: *mut c_void) -> *mut IoEventInternal>

Creates a new IO event source object.

§io_enable: Option<extern "C" fn(e: *mut IoEventInternal, events: IoEventFlagSet)>

Enables or disables IO events on this object.

§io_free: Option<extern "C" fn(e: *mut IoEventInternal)>

Frees a IO event source object.

§io_set_destroy: Option<extern "C" fn(e: *mut IoEventInternal, cb: Option<IoEventDestroyCb>)>

Sets 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: *const MainloopApi, tv: *const timeval, cb: Option<TimeEventCb>, userdata: *mut c_void) -> *mut TimeEventInternal>

Creates a new timer event source object for the specified Unix time.

§time_restart: Option<extern "C" fn(e: *mut TimeEventInternal, tv: *const timeval)>

Restarts a running or expired timer event source with a new Unix time.

§time_free: Option<extern "C" fn(e: *mut TimeEventInternal)>

Frees a deferred timer event source object.

§time_set_destroy: Option<extern "C" fn(e: *mut TimeEventInternal, cb: Option<TimeEventDestroyCb>)>

Sets 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: *const MainloopApi, cb: Option<DeferEventCb>, userdata: *mut c_void) -> *mut DeferEventInternal>

Creates a new deferred event source object.

§defer_enable: Option<extern "C" fn(e: *mut DeferEventInternal, b: i32)>

Enables or disables a deferred event source temporarily.

§defer_free: Option<extern "C" fn(e: *mut DeferEventInternal)>

Frees a deferred event source object.

§defer_set_destroy: Option<extern "C" fn(e: *mut DeferEventInternal, cb: Option<DeferEventDestroyCb>)>

Sets 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: *const MainloopApi, retval: RetvalActual)>

Exits the main loop and return the specified retval.

Trait Implementations§

source§

impl AsRef<pa_mainloop_api> for MainloopApi

source§

fn as_ref(&self) -> &pa_mainloop_api

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> From<&'a MainloopApi> for *const ApiInternal

source§

fn from(a: &'a MainloopApi) -> Self

Converts to this type from the input type.
source§

impl<'a> From<*const pa_mainloop_api> for &'a MainloopApi

source§

fn from(a: *const ApiInternal) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.