Trait shipyard::Get[][src]

pub trait Get {
    type Out;
    type FastOut;
    fn get(self, entity: EntityId) -> Result<Self::Out, MissingComponent>;
fn fast_get(
        self,
        entity: EntityId
    ) -> Result<Self::FastOut, MissingComponent>; }

Retrives components based on their type and entity id.

Associated Types

Loading content...

Required methods

fn get(self, entity: EntityId) -> Result<Self::Out, MissingComponent>[src]

Retrieve components of entity.

Multiple components can be queried at the same time using a tuple.

Example:

use shipyard::{Get, View, World};

let mut world = World::new();

let entity = world.add_entity((0usize, 1u32));

let (usizes, u32s) = world.borrow::<(View<usize>, View<u32>)>().unwrap();
assert_eq!((&usizes, &u32s).get(entity), Ok((&0, &1)));

fn fast_get(self, entity: EntityId) -> Result<Self::FastOut, MissingComponent>[src]

Retrieve components of entity without fine modification tracking.

Multiple components can be queried at the same time using a tuple.

Example:

use shipyard::{Get, View, World};

let mut world = World::new();

let entity = world.add_entity((0usize, 1u32));

let (usizes, u32s) = world.borrow::<(View<usize>, View<u32>)>().unwrap();
assert_eq!((&usizes, &u32s).fast_get(entity), Ok((&0, &1)));
Loading content...

Implementations on Foreign Types

impl<A: Get> Get for (A,)[src]

type Out = (A::Out,)

type FastOut = (A::FastOut,)

impl<A: Get, B: Get> Get for (A, B)[src]

type Out = (A::Out, B::Out)

type FastOut = (A::FastOut, B::FastOut)

impl<A: Get, B: Get, C: Get> Get for (A, B, C)[src]

type Out = (A::Out, B::Out, C::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut)

impl<A: Get, B: Get, C: Get, D: Get> Get for (A, B, C, D)[src]

type Out = (A::Out, B::Out, C::Out, D::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get> Get for (A, B, C, D, E)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get, F: Get> Get for (A, B, C, D, E, F)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut, F::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get, F: Get, G: Get> Get for (A, B, C, D, E, F, G)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out, G::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut, F::FastOut, G::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get, F: Get, G: Get, H: Get> Get for (A, B, C, D, E, F, G, H)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out, G::Out, H::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut, F::FastOut, G::FastOut, H::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get, F: Get, G: Get, H: Get, I: Get> Get for (A, B, C, D, E, F, G, H, I)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out, G::Out, H::Out, I::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut, F::FastOut, G::FastOut, H::FastOut, I::FastOut)

impl<A: Get, B: Get, C: Get, D: Get, E: Get, F: Get, G: Get, H: Get, I: Get, J: Get> Get for (A, B, C, D, E, F, G, H, I, J)[src]

type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out, G::Out, H::Out, I::Out, J::Out)

type FastOut = (A::FastOut, B::FastOut, C::FastOut, D::FastOut, E::FastOut, F::FastOut, G::FastOut, H::FastOut, I::FastOut, J::FastOut)

Loading content...

Implementors

impl<'a: 'b, 'b, T: 'static> Get for &'b View<'a, T>[src]

type Out = &'b T

type FastOut = &'b T

impl<'a: 'b, 'b, T: 'static> Get for &'b ViewMut<'a, T>[src]

type Out = &'b T

type FastOut = &'b T

impl<'a: 'b, 'b, T: 'static> Get for &'b mut ViewMut<'a, T>[src]

type Out = Mut<'b, T>

type FastOut = &'b mut T

Loading content...