pub trait SampleType<const FORMAT: u32, const COMPONENTS: u32>: Scalar {
type SampleResult: Default;
type Vec2: Default;
type Vec3: Default;
type Vec4: Default + VectorTruncateInto<Self::SampleResult>;
}
Expand description
Marker trait for arguments that accept single scalar values or vectors of scalars. Defines 2-, 3- and 4-component vector types based on the sample type.
Required Associated Types§
Sourcetype SampleResult: Default
type SampleResult: Default
The default vector/scalar of this sample type
Sourcetype Vec4: Default + VectorTruncateInto<Self::SampleResult>
type Vec4: Default + VectorTruncateInto<Self::SampleResult>
A 4-component vector of this sample type
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.