Struct red4ext_rs::StateListener
source · pub struct StateListener(/* private fields */);
Expand description
A listener for state changes in the game application.
The listener can be attached to a specific state type using the SdkEnv::add_listener
method.
Implementations§
source§impl StateListener
impl StateListener
sourcepub fn with_on_enter(self, cb: StateHandler) -> Self
pub fn with_on_enter(self, cb: StateHandler) -> Self
Sets a callback to be called when the state is entered.
sourcepub fn with_on_update(self, cb: StateHandler) -> Self
pub fn with_on_update(self, cb: StateHandler) -> Self
Sets a callback to be called when the state is updated.
sourcepub fn with_on_exit(self, cb: StateHandler) -> Self
pub fn with_on_exit(self, cb: StateHandler) -> Self
Sets a callback to be called when the state is exited.
Trait Implementations§
source§impl Debug for StateListener
impl Debug for StateListener
source§impl Default for StateListener
impl Default for StateListener
source§fn default() -> StateListener
fn default() -> StateListener
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StateListener
impl RefUnwindSafe for StateListener
impl Send for StateListener
impl Sync for StateListener
impl Unpin for StateListener
impl UnwindSafe for StateListener
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more