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 godot_ffi as sys;
39
40pub use crate::private::{get_gdext_panic_context, set_gdext_hook};
41
42// ----------------------------------------------------------------------------------------------------------------------------------------------
43// Validations (see also godot/lib.rs)
44
45#[cfg(all(feature = "register-docs", before_api = "4.3"))] #[cfg_attr(published_docs, doc(cfg(all(feature = "register-docs", before_api = "4.3"))))]
46compile_error!("Generating editor docs for Rust symbols requires at least Godot 4.3.");
47
48// ----------------------------------------------------------------------------------------------------------------------------------------------
49// Generated code
50
51// Output of generated code. Mimics the file structure, symbols are re-exported.
52#[rustfmt::skip]
53#[allow(unused_imports, dead_code, non_upper_case_globals, non_snake_case)]
54#[allow(clippy::too_many_arguments, clippy::let_and_return, clippy::new_ret_no_self)]
55#[allow(clippy::let_unit_value)] // let args = ();
56#[allow(clippy::wrong_self_convention)] // to_string() is const
57#[allow(clippy::upper_case_acronyms)] // TODO remove this line once we transform names
58#[allow(clippy::needless_lifetimes)] // the following explicit lifetimes could be elided: 'a
59#[allow(unreachable_code, clippy::unimplemented)] // TODO remove once #153 is implemented
60mod gen {
61 include!(concat!(env!("OUT_DIR"), "/mod.rs"));
62}
63
64// ----------------------------------------------------------------------------------------------------------------------------------------------
65// Hidden but accessible symbols
66
67/// Module which is used for deprecated warnings. It stays even if there is nothing currently deprecated.
68#[doc(hidden)]
69#[path = "deprecated.rs"]
70pub mod __deprecated;
71
72/// All internal machinery that is accessed by various gdext tools (e.g. proc macros).
73#[doc(hidden)]
74pub mod private;
75
76/// Re-export logging macro.
77#[doc(hidden)]
78pub use godot_ffi::out;