Skip to main content

LifecycleDispatcher

Struct LifecycleDispatcher 

Source
pub struct LifecycleDispatcher { /* private fields */ }

Implementations§

Source§

impl LifecycleDispatcher

Source

pub fn set_callback(&self, callback: Box<dyn Fn(AppLifecycle) + Send>)

Source

pub fn add_listener(&self, callback: Box<dyn Fn(AppLifecycle) + Send>) -> u64

Source

pub fn remove_listener(&self, id: u64) -> bool

Source

pub fn current(&self) -> Option<AppLifecycle>

Source

pub fn push(&self, state: AppLifecycle)

Source

pub fn process(&self)

Trait Implementations§

Source§

impl Default for LifecycleDispatcher

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for LifecycleDispatcher

§

impl Forget for LifecycleDispatcher

§

impl Move for LifecycleDispatcher

§

impl RefUnwindSafe for LifecycleDispatcher

§

impl Send for LifecycleDispatcher
where Atomic<u8>: Send, Mutex<Option<Arc<LifecycleSlot>>>: Send, Mutex<Vec<AppLifecycle>>: Send, Mutex<Vec<LifecycleEntry>>: Send, Atomic<u64>: Send, Mutex<()>: Send,

§

impl Sync for LifecycleDispatcher
where Atomic<u8>: Sync, Mutex<Option<Arc<LifecycleSlot>>>: Sync, Mutex<Vec<AppLifecycle>>: Sync, Mutex<Vec<LifecycleEntry>>: Sync, Atomic<u64>: Sync, Mutex<()>: Sync,

§

impl Unpin for LifecycleDispatcher
where Align1<u8>: Unpin, Align4<u32>: Unpin, Arc<LifecycleSlot>: Unpin, *const u8 is !null: Unpin, Align8<u64>: Unpin,

§

impl UnsafeUnpin for LifecycleDispatcher
where Align1<u8>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, *const ArcInner<LifecycleSlot> is !null: UnsafeUnpin, PhantomData<ArcInner<LifecycleSlot>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<AppLifecycle>: UnsafeUnpin, PhantomData<LifecycleEntry>: UnsafeUnpin, Align8<u64>: UnsafeUnpin,

§

impl UnwindSafe for LifecycleDispatcher
where Align1<u8>: UnwindSafe, Mutex<Option<Arc<LifecycleSlot>>>: UnwindSafe, Mutex<Vec<AppLifecycle>>: UnwindSafe, Mutex<Vec<LifecycleEntry>>: UnwindSafe, Align8<u64>: UnwindSafe, Mutex<()>: UnwindSafe,

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> ErasedDestructor for T
where T: 'static,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.