pub struct ComptimeEventBus { /* private fields */ }Expand description
This event bus allows users to trigger events at compilation time to modify the generated code.
§Warning
Recursion isn’t supported with a runtime end condition, the compilation will fail with a strange error.
Implementations§
Source§impl ComptimeEventBus
impl ComptimeEventBus
Sourcepub fn listener<L: EventListener>(&mut self, listener: L)
pub fn listener<L: EventListener>(&mut self, listener: L)
Registers a new callback to be called when its event is launched.
§Notes
Multiple listeners for a single event type is supported. All the listeners will be called for each event in the same order they were registered.
Sourcepub fn event<E: CubeType + 'static>(&mut self, event: E)
pub fn event<E: CubeType + 'static>(&mut self, event: E)
Registers a new event to be processed by registered listeners.
pub fn __expand_new(scope: &mut Scope) -> <Self as CubeType>::ExpandType
pub fn __expand_listener<L: EventListener>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, listener: <L as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
pub fn __expand_event<E: CubeType + 'static>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, event: <E as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
Trait Implementations§
Source§impl Clone for ComptimeEventBus
impl Clone for ComptimeEventBus
Source§fn clone(&self) -> ComptimeEventBus
fn clone(&self) -> ComptimeEventBus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CubeType for ComptimeEventBus
impl CubeType for ComptimeEventBus
type ExpandType = ComptimeEventBusExpand
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Auto Trait Implementations§
impl Freeze for ComptimeEventBus
impl !RefUnwindSafe for ComptimeEventBus
impl !Send for ComptimeEventBus
impl !Sync for ComptimeEventBus
impl Unpin for ComptimeEventBus
impl !UnwindSafe for ComptimeEventBus
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