use crate::{
registry::Registry,
world::World,
};
pub struct SendableWorld<R, Resources>(*mut World<R, Resources>)
where
R: Registry;
impl<R, Resources> SendableWorld<R, Resources>
where
R: Registry,
{
pub(crate) unsafe fn new(world: *mut World<R, Resources>) -> Self {
Self(world)
}
pub(crate) unsafe fn get(self) -> *mut World<R, Resources> {
self.0
}
}
impl<R, Resources> Clone for SendableWorld<R, Resources>
where
R: Registry,
{
fn clone(&self) -> Self {
*self
}
}
impl<R, Resources> Copy for SendableWorld<R, Resources> where R: Registry {}
unsafe impl<R, Resources> Send for SendableWorld<R, Resources> where R: Registry {}
unsafe impl<R, Resources> Sync for SendableWorld<R, Resources> where R: Registry {}