pub trait InstanceBatch:
Any
+ Debug
+ Send
+ Sync {
Show 14 methods
// Required methods
fn len(&self) -> usize;
fn bounds(&self) -> Rect;
fn bytes(&self) -> u64;
fn work(&self) -> u64;
fn validate(&self) -> Result<(), ValidationError>;
fn sample(
&self,
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError>;
fn as_any(&self) -> &dyn Any;
fn content_eq(&self, other: &dyn InstanceBatch) -> bool;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn blend(&self) -> InstanceBlend { ... }
fn spatial(&self) -> Option<&dyn SpatialInstances> { ... }
fn sample_with_zero_identity(
&self,
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError> { ... }
fn upload_bytes(&self) -> u64 { ... }
fn upload(&self) -> Result<Option<InstanceUpload>, ValidationError> { ... }
}Expand description
Immutable instance data, independent of a particular renderer or simulator.
Required Methods§
Sourcefn validate(&self) -> Result<(), ValidationError>
fn validate(&self) -> Result<(), ValidationError>
Validates all stored instance/style values, including hidden instances.
Sourcefn sample(
&self,
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError>
fn sample( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>
Samples instances in their declared order using the consumer’s compositor.
Sourcefn content_eq(&self, other: &dyn InstanceBatch) -> bool
fn content_eq(&self, other: &dyn InstanceBatch) -> bool
Compares the logical payload of two instance records.
Provided Methods§
Sourcefn blend(&self) -> InstanceBlend
fn blend(&self) -> InstanceBlend
Batch compositing policy; the default is source-over.
Sourcefn spatial(&self) -> Option<&dyn SpatialInstances>
fn spatial(&self) -> Option<&dyn SpatialInstances>
Optional conservative supports and ordered sampling; defaults to full-batch traversal.
Sourcefn sample_with_zero_identity(
&self,
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError>
fn sample_with_zero_identity( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>
Samples with a compositor for which every all-zero source, including
signed zeros, is an infallible identity without observable side effects.
Implementations may omit those calls, but must preserve nonzero sample
order and errors. The default retains the ordinary sampling behavior.
Callers with an arbitrary compositor must use Self::sample instead.
Sourcefn upload_bytes(&self) -> u64
fn upload_bytes(&self) -> u64
Exact upload charge for preflight admission; zero by default for CPU-only batches.
Sourcefn upload(&self) -> Result<Option<InstanceUpload>, ValidationError>
fn upload(&self) -> Result<Option<InstanceUpload>, ValidationError>
Checked evaluated primitives, or None when only CPU sampling is available.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".