pub trait TypedElement: Pod + Sealed {
// Required method
fn matches_layout_with_packing(
layout: SampleLayout,
access: BitPackingAccess,
) -> bool;
// Provided method
fn matches_layout(layout: SampleLayout) -> bool { ... }
}Expand description
Full re-export of zenpixels core types (zero module name collisions!).
Sealed marker trait for Rust scalar, channel-array, or pixel types that carry a
known SampleLayout compatibility contract.
Enforced by PixelBuf::from_typed, PixelView::from_typed, PixelView::row_as,
PixelViewMut::row_as_mut, PixelBuf::row_as, and as_contiguous_typed* to prevent
silent reinterpretation across mismatched sample types, channel orders, or non-Full bit
packing (e.g. Rgba<u8> on BGRA8, u16 on RGBF16, or u16 on P010).
For intentional raw-POD byte reinterpretation (such as viewing f32 bits as u32 or custom
#[repr(C)] POD pixel structs), use the explicit *_transmute* methods.
Required Methods§
Sourcefn matches_layout_with_packing(
layout: SampleLayout,
access: BitPackingAccess,
) -> bool
fn matches_layout_with_packing( layout: SampleLayout, access: BitPackingAccess, ) -> bool
Whether this element type is semantically compatible with layout under an explicit
BitPackingAccess policy.
Provided Methods§
Sourcefn matches_layout(layout: SampleLayout) -> bool
fn matches_layout(layout: SampleLayout) -> bool
Whether this element type is semantically compatible with layout under default
BitPackingAccess::Fail (requiring BitPacking::Full).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".