Struct MainloopInner

Source
pub struct MainloopInner<T>{ /* private fields */ }
Expand description

Mainloop inner wrapper.

This contains the actual main loop object pointers, holding both the pointer to the actual opaque main loop C object, and the pointer to the associated API vtable.

An instance of this type will be held, in an Rc ref counted wrapper both in an outer Mainloop wrapper, and by all event objects. With event objects holding a ref-counted copy, this both gives event objects access to the API pointer, which they need, and also it allows us to ensure that event objects do not outlive the main loop object (which internally owns the API object), and thus ensures correct destruction order of event and main loop objects.

Trait Implementations§

Source§

impl<T> Drop for MainloopInner<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> MainloopInnerType for MainloopInner<T>

This is the actual implementation of the ‘inner type’ trait.

It is not possible to replace this with ‘default’ method implementations within the trait itself since the trait does not know about the existence of the struct attributes being accessed.

Source§

fn get_ptr(&self) -> *mut T

Gets opaque main loop object pointer.

Warning: The pointer is only valid for the lifetime of this object.

Source§

fn get_api_ptr(&self) -> *const MainloopApi

Gets raw API object pointer.

Warning: The pointer is only valid for the lifetime of this object.

Source§

fn get_api(&self) -> &MainloopApi

Gets main loop API object pointer.

Source§

type I = T

Internal mainloop type.
Source§

fn supports_rtclock(&self) -> bool

Returns true if the mainloop implementation supports monotonic based time events.
Source§

unsafe fn new( ptr: *mut Self::I, api: *const MainloopApi, dropfn: fn(&mut MainloopInner<Self::I>), supports_rtclock: bool, ) -> MainloopInner<Self::I>

Create a new instance

Auto Trait Implementations§

§

impl<T> Freeze for MainloopInner<T>

§

impl<T> RefUnwindSafe for MainloopInner<T>
where T: RefUnwindSafe,

§

impl<T> !Send for MainloopInner<T>

§

impl<T> !Sync for MainloopInner<T>

§

impl<T> Unpin for MainloopInner<T>

§

impl<T> UnwindSafe for MainloopInner<T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.