[][src]Struct bevy_render::batch::Batcher

pub struct Batcher<TKey, TValue, TData> where
    TKey: Key
{ pub batches: HashMap<BatchKey<TKey>, Batch<TKey, TValue, TData>>, pub is_index: Vec<fn(_: &TKey) -> bool>, pub key_states: HashMap<TValue, BatcherKeyState<TKey>>, pub key_count: usize, }

An unordered batcher intended to support an arbitrary number of keys of the same type (but with some distinguishing factor) NOTE: this may or may not be useful for anything. when paired with a higher-level "BatcherSet" it would allow updating batches

Fields

batches: HashMap<BatchKey<TKey>, Batch<TKey, TValue, TData>>is_index: Vec<fn(_: &TKey) -> bool>key_states: HashMap<TValue, BatcherKeyState<TKey>>key_count: usize

Implementations

impl<TKey, TValue, TData> Batcher<TKey, TValue, TData> where
    TKey: Key,
    TValue: Clone + Eq + Hash,
    TData: Default
[src]

pub fn new(is_index: Vec<fn(_: &TKey) -> bool>) -> Self[src]

pub fn get_batch(
    &self,
    batch_key: &BatchKey<TKey>
) -> Option<&Batch<TKey, TValue, TData>>
[src]

pub fn get_batch_mut(
    &mut self,
    batch_key: &BatchKey<TKey>
) -> Option<&mut Batch<TKey, TValue, TData>>
[src]

pub fn add(&mut self, key: TKey, value: TValue) -> bool[src]

pub fn iter(&self) -> impl Iterator<Item = &Batch<TKey, TValue, TData>>[src]

pub fn iter_mut(
    &mut self
) -> impl Iterator<Item = &mut Batch<TKey, TValue, TData>>
[src]

Auto Trait Implementations

impl<TKey, TValue, TData> RefUnwindSafe for Batcher<TKey, TValue, TData> where
    TData: RefUnwindSafe,
    TKey: RefUnwindSafe,
    TValue: RefUnwindSafe

impl<TKey, TValue, TData> Send for Batcher<TKey, TValue, TData> where
    TData: Send,
    TKey: Send + Sync,
    TValue: Send

impl<TKey, TValue, TData> Sync for Batcher<TKey, TValue, TData> where
    TData: Sync,
    TKey: Sync,
    TValue: Sync

impl<TKey, TValue, TData> Unpin for Batcher<TKey, TValue, TData> where
    TData: Unpin,
    TKey: Unpin,
    TValue: Unpin

impl<TKey, TValue, TData> UnwindSafe for Batcher<TKey, TValue, TData> where
    TData: UnwindSafe,
    TKey: RefUnwindSafe + UnwindSafe,
    TValue: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

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

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

impl<T> Resource for T where
    T: 'static + Send + Sync
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,