use std::any::TypeId;
use crate::entity::{ealloc, referrer};
use crate::world;
use crate::world::offline;
mod rw;
pub use rw::{
Mut, Read, ReadChunk, ReadIsotope, ReadSimple, Write, WriteChunk, WriteIsotope, WriteSimple,
};
pub(crate) mod accessor;
pub use accessor::{Accessor, Chunked as ChunkedAccessor};
pub mod partition;
pub use partition::{EntityCreationPartition, Partition};
mod entity;
#[doc(hidden)]
pub use entity::{entity_iterator, EntityCreatorImpl, EntityDeleterImpl};
pub use entity::{EntityCreator, EntityDeleter, EntityIterator};
pub mod spec;
#[doc(inline)]
pub use spec::Spec;
pub trait Descriptor {
fn get_spec(&self) -> Spec;
fn visit_type(&self, arg: &mut referrer::VisitTypeArg);
fn state_maybe_uninit(&self) -> Vec<TypeId> { Vec::new() }
fn visit_mut(&mut self) -> referrer::AsObject<'_>;
}
pub trait Sendable: Send + Descriptor {
fn run(
&mut self,
globals: &world::SyncGlobals,
components: &world::Components,
ealloc_shard_map: &mut ealloc::ShardMap,
offline_shard: &mut offline::BufferShard,
);
fn as_descriptor_mut(&mut self) -> &mut dyn Descriptor;
}
pub trait Unsendable: Descriptor {
fn run(
&mut self,
sync_globals: &world::SyncGlobals,
unsync_globals: &mut world::UnsyncGlobals,
components: &world::Components,
ealloc_shard_map: &mut ealloc::ShardMap,
offline_shard: &mut offline::BufferShard,
);
fn as_descriptor_mut(&mut self) -> &mut dyn Descriptor;
}