Struct gdnative_async::Spawner
source · [−]pub struct Spawner<'a, C: NativeClass> { /* private fields */ }
Expand description
A helper structure for working around naming future types. See Spawner::spawn
.
Implementations
sourceimpl<'a, C: NativeClass> Spawner<'a, C>
impl<'a, C: NativeClass> Spawner<'a, C>
sourcepub fn spawn<F, R>(self, f: F)where
F: FnOnce(Arc<Context>, TInstance<'_, C>, Varargs<'_>) -> R,
R: Future<Output = Variant> + 'static,
pub fn spawn<F, R>(self, f: F)where
F: FnOnce(Arc<Context>, TInstance<'_, C>, Varargs<'_>) -> R,
R: Future<Output = Variant> + 'static,
Consumes this Spawner
and spawns a future returned by the closure. This indirection
is necessary so that implementors of the AsyncMethod
trait do not have to name their
future types.
Auto Trait Implementations
impl<'a, C> !RefUnwindSafe for Spawner<'a, C>
impl<'a, C> !Send for Spawner<'a, C>
impl<'a, C> !Sync for Spawner<'a, C>
impl<'a, C> Unpin for Spawner<'a, C>where
<C as NativeClass>::UserData: Unpin,
impl<'a, C> !UnwindSafe for Spawner<'a, C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more