pub struct CallbackActionExecutor<F>(pub F)
where
F: Fn(&LoopSpec, &ProposedAction, &mut World) -> Result<ActionReceipt, ActionError> + Send + Sync;Expand description
Wrap a synchronous callback as an ActionExecutor. Use this for
application-specific handoffs without defining a bespoke type.
Tuple Fields§
§0: FTrait Implementations§
Source§impl<F> ActionExecutor for CallbackActionExecutor<F>where
F: Fn(&LoopSpec, &ProposedAction, &mut World) -> Result<ActionReceipt, ActionError> + Send + Sync,
impl<F> ActionExecutor for CallbackActionExecutor<F>where
F: Fn(&LoopSpec, &ProposedAction, &mut World) -> Result<ActionReceipt, ActionError> + Send + Sync,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
spec: &'life1 LoopSpec,
action: &'life2 ProposedAction,
world: &'life3 mut World,
) -> Pin<Box<dyn Future<Output = Result<ActionReceipt, ActionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Auto Trait Implementations§
impl<F> Freeze for CallbackActionExecutor<F>where
F: Freeze,
impl<F> RefUnwindSafe for CallbackActionExecutor<F>where
F: RefUnwindSafe,
impl<F> Send for CallbackActionExecutor<F>
impl<F> Sync for CallbackActionExecutor<F>
impl<F> Unpin for CallbackActionExecutor<F>where
F: Unpin,
impl<F> UnsafeUnpin for CallbackActionExecutor<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for CallbackActionExecutor<F>where
F: UnwindSafe,
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