godot_core/task/
mod.rs

1/*
2 * Copyright (c) godot-rust; Bromeon and contributors.
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 */
7
8//! Integrates async rust code with the engine.
9//!
10//! This module contains:
11//! - Implementations of [`Future`](std::future::Future) for [`Signal`](crate::builtin::Signal) and [`TypedSignal`](crate::registry::signal::TypedSignal).
12//! - A way to [`spawn`] new async tasks by using the engine as the async runtime.
13
14mod async_runtime;
15mod futures;
16
17pub(crate) use async_runtime::cleanup;
18pub(crate) use futures::{impl_dynamic_send, ThreadConfined};
19
20pub use async_runtime::{spawn, TaskHandle};
21pub use futures::{
22    DynamicSend, FallibleSignalFuture, FallibleSignalFutureError, IntoDynamicSend, SignalFuture,
23};
24
25// Only exported for itest.
26#[cfg(feature = "trace")] #[cfg_attr(published_docs, doc(cfg(feature = "trace")))]
27pub use async_runtime::has_godot_task_panicked;
28#[cfg(feature = "trace")] #[cfg_attr(published_docs, doc(cfg(feature = "trace")))]
29pub use futures::{create_test_signal_future_resolver, SignalFutureResolver};