Component

Trait Component 

Source
pub unsafe trait Component {
    // Required method
    fn is_valid(format: Format<'_>) -> bool;
}
Expand description

A trait for possible pixel components.

§Safety

Implementing this trait allows retrieving slices of pixel data from the frame for the target type, so the target type must be valid for the given format.

Required Methods§

Source

fn is_valid(format: Format<'_>) -> bool

Returns whether this component is valid for this format.

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 Component for f32

Source§

fn is_valid(format: Format<'_>) -> bool

Source§

impl Component for u8

Source§

fn is_valid(format: Format<'_>) -> bool

Source§

impl Component for u16

Source§

fn is_valid(format: Format<'_>) -> bool

Source§

impl Component for u32

Source§

fn is_valid(format: Format<'_>) -> bool

Source§

impl Component for f16

Available on crate feature f16-pixel-type only.
Source§

fn is_valid(format: Format<'_>) -> bool

Implementors§