Trait PhaseItem

Source
pub trait PhaseItem {
    type SortKey: Ord;

    // Required methods
    fn sort_key(&self) -> Self::SortKey;
    fn draw_function(&self) -> &dyn Draw<Self>;
}
Expand description

An item which will be drawn to the screen. A phase item should be queued up for rendering during the RenderStageLabel::Queue stage. Afterwards it will be sorted and rendered automatically in the RenderStageLabel::PhaseSort stage and RenderStageLabel::Render stage, respectively.

Required Associated Types§

Source

type SortKey: Ord

The type used for ordering the items. The smallest values are drawn first.

Required Methods§

Source

fn sort_key(&self) -> Self::SortKey

Determines the order in which the items are drawn during the corresponding RenderPhase.

Source

fn draw_function(&self) -> &dyn Draw<Self>

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.

Implementors§