Struct shipyard::Not[][src]

pub struct Not<T>(_);

Used to filter out components.

Get and iterators will skip entities that have this component.
Simply add ! in front of the view reference at iterator creation.

Example

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

let mut world = World::new();

world.add_entity((0usize, 1u32));
world.add_entity((2usize,));

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

let mut iter = (&usizes, !&u32s).iter();
assert_eq!(iter.next(), Some((&2, ())));
assert_eq!(iter.next(), None);
let mut iter = (&usizes, &u32s).iter();
assert_eq!(iter.next(), Some((&0, &1)));
assert_eq!(iter.next(), None);

Trait Implementations

impl<T: Clone> Clone for Not<T>[src]

impl<T: Copy> Copy for Not<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Not<T> where
    T: RefUnwindSafe

impl<T> Send for Not<T> where
    T: Send

impl<T> Sync for Not<T> where
    T: Sync

impl<T> Unpin for Not<T> where
    T: Unpin

impl<T> UnwindSafe for Not<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.