godot_core/lib.rs
1#![cfg_attr(published_docs, feature(doc_cfg))]
2/*
3 * Copyright (c) godot-rust; Bromeon and contributors.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 */
8
9//! # Internal crate of [**godot-rust**](https://godot-rust.github.io)
10//!
11//! Do not depend on this crate directly, instead use the `godot` crate.
12//! No SemVer or other guarantees are provided.
13
14// Note that a lot of those are public, but the godot crate still has the final say on what it wants to re-export.
15// Doing fine-grained visibility restrictions on every level is a useless maintenance chore.
16pub mod builder;
17pub mod builtin;
18pub mod classes;
19#[cfg(all(since_api = "4.3", feature = "register-docs"))] #[cfg_attr(published_docs, doc(cfg(all(since_api = "4.3", feature = "register-docs"))))]
20pub mod docs;
21#[doc(hidden)]
22pub mod possibly_docs {
23 #[cfg(all(since_api = "4.3", feature = "register-docs"))] #[cfg_attr(published_docs, doc(cfg(all(since_api = "4.3", feature = "register-docs"))))]
24 pub use crate::docs::*;
25}
26pub mod global;
27pub mod init;
28pub mod meta;
29pub mod obj;
30pub mod registry;
31#[cfg(since_api = "4.2")] #[cfg_attr(published_docs, doc(cfg(since_api = "4.2")))]
32pub mod task;
33#[cfg(before_api = "4.2")] #[cfg_attr(published_docs, doc(cfg(before_api = "4.2")))]
34pub mod task {}
35pub mod tools;
36
37mod storage;
38pub use crate::private::{get_gdext_panic_context, set_gdext_hook};
39pub use godot_ffi as sys;
40
41// ----------------------------------------------------------------------------------------------------------------------------------------------
42// Validations (see also godot/lib.rs)
43
44#[cfg(all(feature = "register-docs", before_api = "4.3"))] #[cfg_attr(published_docs, doc(cfg(all(feature = "register-docs", before_api = "4.3"))))]
45compile_error!("Generating editor docs for Rust symbols requires at least Godot 4.3.");
46
47// ----------------------------------------------------------------------------------------------------------------------------------------------
48// Generated code
49
50// Output of generated code. Mimics the file structure, symbols are re-exported.
51#[rustfmt::skip]
52#[allow(unused_imports, dead_code, non_upper_case_globals, non_snake_case)]
53#[allow(clippy::too_many_arguments, clippy::let_and_return, clippy::new_ret_no_self)]
54#[allow(clippy::let_unit_value)] // let args = ();
55#[allow(clippy::wrong_self_convention)] // to_string() is const
56#[allow(clippy::upper_case_acronyms)] // TODO remove this line once we transform names
57#[allow(clippy::needless_lifetimes)] // the following explicit lifetimes could be elided: 'a
58#[allow(unreachable_code, clippy::unimplemented)] // TODO remove once #153 is implemented
59mod gen {
60 include!(concat!(env!("OUT_DIR"), "/mod.rs"));
61}
62
63// ----------------------------------------------------------------------------------------------------------------------------------------------
64// Hidden but accessible symbols
65
66/// Module which is used for deprecated warnings. It stays even if there is nothing currently deprecated.
67#[doc(hidden)]
68#[path = "deprecated.rs"]
69pub mod __deprecated;
70
71/// All internal machinery that is accessed by various gdext tools (e.g. proc macros).
72#[doc(hidden)]
73pub mod private;
74
75/// Re-export logging macro.
76#[doc(hidden)]
77pub use godot_ffi::out;