Trait Access

Source
pub trait Access: Access {
    type Item<'world>;
}
Expand description

A required (&T, &mut T) or optional (Option<&T>, Option<&mut T>) component access, or the entity identity itself.

Optional accesses return optional borrow guards, not naked references. They match every live entity, returning None only for absent components. See World::get and World::query for runnable examples.

Required Associated Types§

Source

type Item<'world>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Access for Option<&T>
where T: 'static,

Source§

type Item<'world> = Option<Ref<'world, T>>

Source§

impl<T> Access for Option<&mut T>
where T: 'static,

Source§

type Item<'world> = Option<RefMut<'world, T>>

Source§

impl<T> Access for &T
where T: 'static,

Source§

type Item<'world> = Ref<'world, T>

Source§

impl<T> Access for &mut T
where T: 'static,

Source§

type Item<'world> = RefMut<'world, T>

Implementors§

Source§

impl Access for Entity

Source§

type Item<'world> = Entity