pub struct EcsAccessManager {
ecs_pointer: AtomicPtr<EcsWorld<'static, 'static>>,
}
Expand description
This structure wraps the ECS pointer to ensure safety
Fields§
§ecs_pointer: AtomicPtr<EcsWorld<'static, 'static>>
Implementations§
source§impl EcsAccessManager
impl EcsAccessManager
pub fn execute_with<T>( &self, world: &EcsWorld<'_, '_>, func: impl FnOnce() -> T, ) -> T
sourcepub unsafe fn get(&self) -> Option<&EcsWorld<'_, '_>>
pub unsafe fn get(&self) -> Option<&EcsWorld<'_, '_>>
This unsafe function returns a reference to the Ecs World
§Safety
This function is safe to use if it matches the following requirements
- The reference and subreferences like Entities, Components … aren’t leaked out the thread
- The reference and subreferences lifetime doesn’t exceed the source function lifetime
- Always safe when called from
retrieve_action
if you don’t pass a reference somewhere else - All that ensure that the reference doesn’t exceed the execute_with function scope
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EcsAccessManager
impl RefUnwindSafe for EcsAccessManager
impl Send for EcsAccessManager
impl Sync for EcsAccessManager
impl Unpin for EcsAccessManager
impl !UnwindSafe for EcsAccessManager
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.