Enum ambient_api::prelude::ButtonCb
source · pub enum ButtonCb {
Sync(Arc<CbDebuggable<dyn Fn(&mut World) + Sync + Send>>),
Async(Arc<CbDebuggable<dyn Fn(()) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>>),
}
Expand description
The callback invoked when a button is clicked.
Variants§
Sync(Arc<CbDebuggable<dyn Fn(&mut World) + Sync + Send>>)
A synchronous callback.
Async(Arc<CbDebuggable<dyn Fn(()) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>>)
An asynchronous callback.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ButtonCb
impl Send for ButtonCb
impl Sync for ButtonCb
impl Unpin for ButtonCb
impl !UnwindSafe for ButtonCb
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
source§impl<T> Downcast for T
impl<T> Downcast for T
source§impl<T> ElementComponentName for T
impl<T> ElementComponentName for T
source§fn element_component_name(&self) -> &'static str
fn element_component_name(&self) -> &'static str
Returns the name of the type implementing ElementComponent.