Skip to main content

ContextBase

Trait ContextBase 

Source
pub trait ContextBase: Sized {
Show 18 methods // Required methods fn subscribe_to_event<E: IxaEvent>( &mut self, handler: impl Fn(&mut Context, E) + 'static, ) -> EventListenerId<E>; fn unsubscribe_from_event<E: IxaEvent>( &mut self, listener_id: &EventListenerId<E>, ) -> bool; fn emit_event<E: IxaEvent>(&mut self, event: E); fn add_plan( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId; fn add_plan_with_phase( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId; fn add_passive_plan( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId; fn add_passive_plan_with_phase( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId; fn add_shutdown_plan( &mut self, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId; fn add_shutdown_plan_with_phase( &mut self, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId; fn add_periodic_plan_with_phase( &mut self, period: impl Into<f64>, callback: impl Fn(&mut Context) + 'static, phase: ExecutionPhase, ); fn cancel_plan(&mut self, plan_id: &PlanId); fn queue_callback(&mut self, callback: impl FnOnce(&mut Context) + 'static); fn get_data_mut<T: DataPlugin>( &mut self, plugin: T, ) -> &mut T::DataContainer; fn get_data<T: DataPlugin>(&self, plugin: T) -> &T::DataContainer; fn get_current_time(&self) -> f64; fn get_execution_statistics(&mut self) -> ExecutionStatistics; fn abort(&mut self); // Provided method fn schedule_shutdown(&mut self, time: f64) -> PlanId { ... }
}

Required Methods§

Source

fn subscribe_to_event<E: IxaEvent>( &mut self, handler: impl Fn(&mut Context, E) + 'static, ) -> EventListenerId<E>

Source

fn unsubscribe_from_event<E: IxaEvent>( &mut self, listener_id: &EventListenerId<E>, ) -> bool

Source

fn emit_event<E: IxaEvent>(&mut self, event: E)

Source

fn add_plan( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId

Source

fn add_plan_with_phase( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId

Source

fn add_passive_plan( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId

Source

fn add_passive_plan_with_phase( &mut self, time: impl Into<f64>, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId

Source

fn add_shutdown_plan( &mut self, callback: impl FnOnce(&mut Context) + 'static, ) -> PlanId

Source

fn add_shutdown_plan_with_phase( &mut self, callback: impl FnOnce(&mut Context) + 'static, phase: ExecutionPhase, ) -> PlanId

Source

fn add_periodic_plan_with_phase( &mut self, period: impl Into<f64>, callback: impl Fn(&mut Context) + 'static, phase: ExecutionPhase, )

Source

fn cancel_plan(&mut self, plan_id: &PlanId)

Source

fn queue_callback(&mut self, callback: impl FnOnce(&mut Context) + 'static)

Source

fn get_data_mut<T: DataPlugin>(&mut self, plugin: T) -> &mut T::DataContainer

Source

fn get_data<T: DataPlugin>(&self, plugin: T) -> &T::DataContainer

Source

fn get_current_time(&self) -> f64

Source

fn get_execution_statistics(&mut self) -> ExecutionStatistics

Source

fn abort(&mut self)

Provided Methods§

Source

fn schedule_shutdown(&mut self, time: f64) -> PlanId

Schedule normal shutdown as a passive plan at the specified maximum time.

See Context::schedule_shutdown for full behavior and panic semantics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§