pub unsafe trait Pixel: Copy {
// Required method
fn matches_color_type(ct: ColorType) -> bool;
}
Expand description
Implement this trait to use a pixel type in Handle<Pixmap>::pixels()
.
§Safety
This trait is unsafe because external Pixel
implementations may lie about their
ColorType
or fail to match the alignment of the pixels stored in Handle<Pixmap>
.
Required Methods§
Sourcefn matches_color_type(ct: ColorType) -> bool
fn matches_color_type(ct: ColorType) -> bool
true
if the type matches the color type’s 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.