#![warn(missing_docs)]
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#[cfg(feature = "std")]
extern crate std;
extern crate alloc;
macro_rules! smaller_tuples_too {
($m: ident, $elem: tt) => {
$m!{}
$m!{$elem}
};
($m: ident, $elem: tt, $($tt: tt),*) => {
smaller_tuples_too!{$m, $($tt),*}
$m!{$elem, $($tt),*}
};
}
mod archetype;
mod batch;
mod borrow;
mod bundle;
mod dynamic_query;
mod entities;
mod entity_builder;
mod entity_ref;
mod query;
mod query_one;
#[cfg(any(feature = "row-serialize", feature = "column-serialize"))]
pub mod serialize;
mod world;
pub use archetype::Archetype;
pub use batch::{BatchIncomplete, BatchWriter, ColumnBatch, ColumnBatchBuilder, ColumnBatchType};
pub use bundle::{Bundle, DynamicBundle, MissingComponent};
pub use dynamic_query::{
DynamicComponent, DynamicItem, DynamicQuery, DynamicQueryBorrow, DynamicQueryIter, DynamicWith,
DynamicWithout, Ref as DynamicItemRef, RefMut as DynamicItemRefMut,
};
pub use entities::{Entity, NoSuchEntity};
pub use entity_builder::{BuiltEntity, Cloneable, EntityBuilder, ReusableBuiltEntity};
pub use entity_ref::{EntityRef, Ref, RefMut};
pub use query::{
Access, Batch, BatchedIter, Or, PreparedQuery, PreparedQueryBorrow, PreparedQueryIter, Query,
QueryBorrow, QueryItem, QueryIter, QueryMut, Satisfies, With, Without,
};
pub use query_one::QueryOne;
pub use world::{
ArchetypesGeneration, Component, ComponentError, Iter, QueryOneError, SpawnBatchIter,
SpawnColumnBatchIter, World,
};
#[doc(hidden)]
pub use archetype::TypeInfo;
#[cfg(feature = "macros")]
#[doc(hidden)]
pub use lazy_static;
#[doc(hidden)]
pub use query::Fetch;
#[cfg(feature = "macros")]
pub use hecs_macros::{Bundle, Query};
fn align(x: usize, alignment: usize) -> usize {
debug_assert!(alignment.is_power_of_two());
(x + alignment - 1) & (!alignment + 1)
}