godot-core 0.5.1

Internal crate used by godot-rust
Documentation
/*
 * Copyright (c) godot-rust; Bromeon and contributors.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

//! Integrates async rust code with the engine.
//!
//! This module contains:
//! - Implementations of [`Future`] for [`Signal`][crate::builtin::Signal] and [`TypedSignal`][crate::obj::signal::TypedSignal].
//! - A way to [`spawn`] new async tasks by using the engine as the async runtime.

mod async_runtime;
mod futures;

// Public re-exports
pub use async_runtime::{TaskHandle, spawn};
pub use futures::{
    DynamicSend, FallibleSignalFuture, FallibleSignalFutureError, IntoDynamicSend, SignalFuture,
};

// For use in integration tests.
#[cfg(feature = "trace")] #[cfg_attr(published_docs, doc(cfg(feature = "trace")))]
mod reexport_test {
    pub use super::async_runtime::has_godot_task_panicked;
    pub use super::futures::{SignalFutureResolver, create_test_signal_future_resolver};
}

#[cfg(feature = "trace")] #[cfg_attr(published_docs, doc(cfg(feature = "trace")))]
pub use reexport_test::*;

// Crate-local re-exports.
mod reexport_crate {
    pub(crate) use super::async_runtime::cleanup;
    pub(crate) use super::futures::{ThreadConfined, impl_dynamic_send};
}

pub(crate) use reexport_crate::*;