Trait DynamicBundle

Source
pub unsafe trait DynamicBundle {
    // Provided method
    fn has<T>(&self) -> bool
       where T: Component { ... }
}
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>(&self) -> bool
where T: Component,

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>());

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 DynamicBundle for ()

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§