#![doc = concat!("[All examples]: https://github.com/madsmtm/objc2/tree/objc2-", env!("CARGO_PKG_VERSION"), "/examples")]
#![cfg_attr(target_os = "macos", doc = "```no_run")]
#![cfg_attr(not(target_os = "macos"), doc = "```ignore")]
#![doc = include_str!("../examples/hello_world_app.rs")]
#![doc = concat!(
"[`Cargo.toml`]: https://docs.rs/crate/objc2/",
env!("CARGO_PKG_VERSION"),
"/source/Cargo.toml.orig",
)]
#![no_std]
#![cfg_attr(
feature = "unstable-autoreleasesafe",
feature(negative_impls, auto_traits)
)]
#![cfg_attr(
feature = "unstable-arbitrary-self-types",
feature(arbitrary_self_types)
)]
#![cfg_attr(
feature = "unstable-coerce-pointee",
feature(derive_coerce_pointee, trait_upcasting)
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, doc(auto_cfg(hide(feature = "unstable-objfw"))))]
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]
#![warn(clippy::missing_errors_doc)]
#![warn(clippy::missing_panics_doc)]
#![doc(html_root_url = "https://docs.rs/objc2/0.6.3")]
#[cfg(not(feature = "alloc"))]
compile_error!("The `alloc` feature currently must be enabled.");
#[cfg(not(feature = "std"))]
compile_error!("The `std` feature currently must be enabled.");
extern crate alloc;
extern crate std;
pub use self::downcast::DowncastTarget;
#[doc(no_inline)]
pub use self::encode::{Encode, Encoding, RefEncode};
pub use self::main_thread_marker::MainThreadMarker;
pub use self::top_level_traits::{
AnyThread, ClassType, DefinedClass, MainThreadOnly, Message, ProtocolType, ThreadKind,
};
#[cfg(any(feature = "unstable-static-sel", feature = "unstable-static-class"))]
#[doc(hidden)]
pub use objc2_proc_macros::__hash_idents;
#[cfg(not(any(feature = "unstable-static-sel", feature = "unstable-static-class")))]
#[doc(hidden)]
#[macro_export]
macro_rules! __hash_idents {
($($x:tt)*) => {
()
};
}
#[doc(hidden)]
pub mod __framework_prelude;
#[doc(hidden)]
pub mod __macro_helpers;
mod downcast;
pub mod encode;
pub mod exception;
pub mod ffi;
mod macros;
mod main_thread_marker;
pub mod rc;
pub mod runtime;
#[cfg(test)]
mod test_utils;
mod top_level_traits;
#[cfg(any(docsrs, doc, doctest, test))]
pub mod topics;
mod verify;
#[deprecated = "Moved to the `runtime` module"]
pub mod declare {
use super::runtime;
pub use super::runtime::{ClassBuilder, ProtocolBuilder};
#[deprecated = "Use `runtime::ClassBuilder` instead."]
pub type ClassDecl = runtime::ClassBuilder;
#[deprecated = "Use `runtime::ProtocolBuilder` instead."]
pub type ProtocolDecl = runtime::ProtocolBuilder;
}
#[deprecated = "renamed to DefinedClass"]
pub use DefinedClass as DeclaredClass;
#[deprecated = "renamed to AnyThread"]
pub use AnyThread as AllocAnyThread;
#[cfg(not(feature = "std"))]
compile_error!("The `std` feature currently must be enabled.");
#[cfg(all(
not(docsrs),
not(any(
target_vendor = "apple",
feature = "unstable-compiler-rt",
feature = "gnustep-1-7",
feature = "unstable-objfw",
))
))]
compile_error!("`objc2` only works on Apple platforms. Pass `--target aarch64-apple-darwin` or similar to compile for macOS.\n(If you're absolutely certain that you're using GNUStep, you can specify that with the `gnustep-x-y` Cargo feature instead).");
#[cfg(all(feature = "gnustep-1-7", feature = "unstable-objfw"))]
compile_error!("Only one runtime may be selected");
#[cfg(feature = "unstable-objfw")]
compile_error!("ObjFW is not yet supported");
#[cfg_attr(not(feature = "unstable-objfw"), link(name = "objc", kind = "dylib"))]
#[cfg_attr(feature = "unstable-objfw", link(name = "objfw-rt", kind = "dylib"))]
extern "C" {}
#[cfg_attr(target_vendor = "apple", link(name = "Foundation", kind = "framework"))]
#[cfg_attr(
all(feature = "gnustep-1-7", not(feature = "unstable-compiler-rt")),
link(name = "gnustep-base", kind = "dylib")
)]
extern "C" {}