Trait shipyard::Remove[][src]

pub trait Remove {
    type Out;
    fn remove(&mut self, entity: EntityId) -> Self::Out;
}

Removes component from entities.

Associated Types

type Out[src]

Type of the removed component.

Loading content...

Required methods

fn remove(&mut self, entity: EntityId) -> Self::Out[src]

Removes component in entity, if the entity had a component, they will be returned.
Multiple components can be removed at the same time using a tuple.

Example

use shipyard::{Remove, ViewMut, World};

let mut world = World::new();

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

let (mut usizes, mut u32s) = world.borrow::<(ViewMut<usize>, ViewMut<u32>)>().unwrap();

let old = (&mut usizes, &mut u32s).remove(entity);
assert_eq!(old, (Some(0), Some(1)));
Loading content...

Implementations on Foreign Types

impl Remove for ()[src]

type Out = ()

impl<ViewA: Remove> Remove for (ViewA,)[src]

type Out = (ViewA::Out,)

impl<ViewA: Remove, ViewB: Remove> Remove for (ViewA, ViewB)[src]

type Out = (ViewA::Out, ViewB::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove> Remove for (ViewA, ViewB, ViewC)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove> Remove for (ViewA, ViewB, ViewC, ViewD)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove, ViewF: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out, ViewF::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove, ViewF: Remove, ViewG: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out, ViewF::Out, ViewG::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove, ViewF: Remove, ViewG: Remove, ViewH: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out, ViewF::Out, ViewG::Out, ViewH::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove, ViewF: Remove, ViewG: Remove, ViewH: Remove, ViewI: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH, ViewI)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out, ViewF::Out, ViewG::Out, ViewH::Out, ViewI::Out)

impl<ViewA: Remove, ViewB: Remove, ViewC: Remove, ViewD: Remove, ViewE: Remove, ViewF: Remove, ViewG: Remove, ViewH: Remove, ViewI: Remove, ViewJ: Remove> Remove for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH, ViewI, ViewJ)[src]

type Out = (ViewA::Out, ViewB::Out, ViewC::Out, ViewD::Out, ViewE::Out, ViewF::Out, ViewG::Out, ViewH::Out, ViewI::Out, ViewJ::Out)

Loading content...

Implementors

impl<T: 'static> Remove for &mut ViewMut<'_, T>[src]

type Out = Option<T>

impl<T: 'static> Remove for ViewMut<'_, T>[src]

type Out = Option<T>

Loading content...