Trait hecs::DynamicBundle

source ·
pub unsafe trait DynamicBundle {
    // Provided method
    fn has<T: Component>(&self) -> bool { ... }
}
Expand description

A dynamically typed collection of components

Bundles composed of exactly the same types are semantically equivalent, regardless of order. The interface of this trait, except has is a private implementation detail.

Provided Methods§

source

fn has<T: Component>(&self) -> bool

Checks if the Bundle contains the given T:


let my_bundle = (0i32, 10.0f32);
assert!(my_bundle.has::<i32>());
assert!(my_bundle.has::<f32>());
assert!(!my_bundle.has::<usize>());

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DynamicBundle for ()

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component> DynamicBundle for (A,)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component> DynamicBundle for (A, B)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component> DynamicBundle for (A, B, C)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component> DynamicBundle for (A, B, C, D)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component> DynamicBundle for (A, B, C, D, E)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component> DynamicBundle for (A, B, C, D, E, F)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component> DynamicBundle for (A, B, C, D, E, F, G)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component> DynamicBundle for (A, B, C, D, E, F, G, H)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component, K: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J, K)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component, K: Component, L: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component, K: Component, L: Component, M: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J, K, L, M)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component, K: Component, L: Component, M: Component, N: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

source§

fn has<T: Component>(&self) -> bool

source§

impl<A: Component, B: Component, C: Component, D: Component, E: Component, F: Component, G: Component, H: Component, I: Component, J: Component, K: Component, L: Component, M: Component, N: Component, O: Component> DynamicBundle for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

source§

fn has<T: Component>(&self) -> bool

Implementors§