ark-api 0.17.0-pre.15

Ark API
Documentation
//! ## πŸ’Ž Ark API
//!
//! Also see [πŸ—ΊοΈ APIs in Ark Developer Guide](https://ark.embark.dev/guide/api/index.html)

#![allow(clippy::unused_self)]
#![allow(clippy::undocumented_unsafe_blocks)] // TODO: Remove, comment unsafe blocks instead
#![deny(
    missing_docs,
    rustdoc::broken_intra_doc_links,
    rustdoc::private_intra_doc_links,
    rustdoc::missing_crate_level_docs
)]
#![forbid(clippy::not_unsafe_ptr_arg_deref)]
#![doc(html_favicon_url = "/favicon.png")]
#![doc(html_logo_url = "/logo.png")]

#[cfg(target_arch = "wasm32")]
mod api;
#[cfg(target_arch = "wasm32")]
pub use api::*;

#[cfg(feature = "internal__unstable_apis")]
#[cfg(target_arch = "wasm32")]
mod api_unstable;

#[cfg(feature = "internal__unstable_apis")]
#[cfg(target_arch = "wasm32")]
pub use api_unstable::*;

/// 🚧 Unstable APIs, may change at any time, does not respect semver nor has stable ABI. Use at own risk.
///
/// # Example
///
/// To enable and use these APIs, enable the feature for it, they are all prefixed with `unstable-`
/// ```
/// [dependencies]
/// ark-api = { version = "*", features = ["unstable-sys"] }
#[cfg(feature = "internal__unstable_apis")]
#[cfg(target_arch = "wasm32")]
pub mod unstable {
    pub use super::api_unstable::*;
}

#[cfg(feature = "examples")]
#[doc(hidden)]
pub mod api_examples;

use ark_api_ffi as ffi;

mod types;
pub use types::*;

mod error;
pub use error::*;

// Hide util module from docs as we want to deprecate and remove it
#[doc(hidden)]
pub mod util;

// Re-export Macaw types for easy use, without adding explicit dependency
pub use macaw::Affine3A;
pub use macaw::BoundingBox;
pub use macaw::ColorRgba8;
pub use macaw::Conformal3;
pub use macaw::CoordinateSystem;
pub use macaw::EulerRot;
pub use macaw::IsoTransform;
pub use macaw::Mat3;
pub use macaw::Mat4;
pub use macaw::Plane3;
pub use macaw::Quat;
pub use macaw::Ray3;
pub use macaw::Vec2;
pub use macaw::Vec3;
pub use macaw::Vec4;

// Export standard logging macros
pub use log::debug;
pub use log::error;
pub use log::info;
pub use log::trace;
pub use log::warn;

#[doc(hidden)]
pub use puffin as __puffin;

/// Ark's version of Rust's `#[test]` macro
///
/// ```no_run
/// #[ark_test]
/// fn makes_a_sad() {
///     assert_eq!(1, 2, "me am good in nummers");
/// }
/// ```
#[cfg(all(feature = "test", target_arch = "wasm32"))]
pub use ark_api_macros::ark_test;

/// Like [`std::dbg!`] but uses [`info!`].
#[macro_export]
macro_rules! dbg {
    () => {
        $crate::info!("[{}:{}]", std::file!(), std::line!());
    };
    ($val:expr $(,)?) => {
        match $val {
            tmp => {
                $crate::info!("[{}:{}] {} = {:#?}",
                    std::file!(), std::line!(), std::stringify!($val), &tmp);
                tmp
            }
        }
    };
    ($($val:expr),+ $(,)?) => {
        ($($crate::dbg!($val)),+,)
    };
}