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.
Sourcepub fn __expand_new(scope: &Scope) -> <Self as CubeType>::ExpandType
pub fn __expand_new(scope: &Scope) -> <Self as CubeType>::ExpandType
Creates a new event bus.
Sourcepub fn __expand_listener<L: EventListener>(
scope: &Scope,
this: &mut <Self as CubeType>::ExpandType,
listener: <L as CubeType>::ExpandType,
)
pub fn __expand_listener<L: EventListener>( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, listener: <L as CubeType>::ExpandType, )
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 __expand_event<E: CubeType + 'static>(
scope: &Scope,
this: &mut <Self as CubeType>::ExpandType,
event: <E as CubeType>::ExpandType,
)
pub fn __expand_event<E: CubeType + 'static>( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, event: <E as CubeType>::ExpandType, )
Registers a new event to be processed by registered listeners.
Trait Implementations§
Source§impl Clone for ComptimeEventBus
impl Clone for ComptimeEventBus
Source§fn clone(&self) -> ComptimeEventBus
fn clone(&self) -> ComptimeEventBus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CubeType for ComptimeEventBus
impl CubeType for ComptimeEventBus
Auto Trait Implementations§
impl !RefUnwindSafe for ComptimeEventBus
impl !Send for ComptimeEventBus
impl !Sync for ComptimeEventBus
impl !UnwindSafe for ComptimeEventBus
impl Freeze for ComptimeEventBus
impl Unpin for ComptimeEventBus
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more