ext_php_rs/
lib.rs

1#![doc = include_str!("../README.md")]
2#![deny(clippy::unwrap_used)]
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6#![allow(unsafe_attr_outside_unsafe)]
7#![warn(clippy::pedantic)]
8#![cfg_attr(docs, feature(doc_cfg))]
9#![cfg_attr(windows, feature(abi_vectorcall))]
10
11pub mod alloc;
12pub mod args;
13pub mod binary;
14pub mod binary_slice;
15pub mod builders;
16pub mod convert;
17pub mod error;
18pub mod exception;
19pub mod ffi;
20pub mod flags;
21#[macro_use]
22pub mod macros;
23pub mod boxed;
24pub mod class;
25#[cfg(any(docs, feature = "closure"))]
26#[cfg_attr(docs, doc(cfg(feature = "closure")))]
27pub mod closure;
28pub mod constant;
29pub mod describe;
30#[cfg(feature = "embed")]
31pub mod embed;
32#[cfg(feature = "enum")]
33pub mod enum_;
34#[doc(hidden)]
35pub mod internal;
36pub mod props;
37pub mod rc;
38#[cfg(test)]
39pub mod test;
40pub mod types;
41mod util;
42pub mod zend;
43
44/// A module typically glob-imported containing the typically required macros
45/// and imports.
46pub mod prelude {
47
48    pub use crate::builders::ModuleBuilder;
49    #[cfg(any(docs, feature = "closure"))]
50    #[cfg_attr(docs, doc(cfg(feature = "closure")))]
51    pub use crate::closure::Closure;
52    pub use crate::exception::{PhpException, PhpResult};
53    #[cfg(feature = "enum")]
54    pub use crate::php_enum;
55    pub use crate::php_print;
56    pub use crate::php_println;
57    pub use crate::types::ZendCallable;
58    pub use crate::{
59        ZvalConvert, php_class, php_const, php_extern, php_function, php_impl, php_interface,
60        php_module, wrap_constant, wrap_function, zend_fastcall,
61    };
62}
63
64/// `ext-php-rs` version.
65pub const VERSION: &str = env!("CARGO_PKG_VERSION");
66
67/// Whether the extension is compiled for PHP debug mode.
68pub const PHP_DEBUG: bool = cfg!(php_debug);
69
70/// Whether the extension is compiled for PHP thread-safe mode.
71pub const PHP_ZTS: bool = cfg!(php_zts);
72
73#[cfg(feature = "enum")]
74pub use ext_php_rs_derive::php_enum;
75pub use ext_php_rs_derive::{
76    ZvalConvert, php_class, php_const, php_extern, php_function, php_impl, php_interface,
77    php_module, wrap_constant, wrap_function, zend_fastcall,
78};