pub trait SimpleExactSourceDescriptor: SourceCleanup {
type Item;
// Required method
unsafe fn simple_exact_fetch_item(&self, index: usize) -> Self::Item;
}Expand description
A simple interface describing how to fetch items from an
ExactParallelSource.
This is a variant of ExactSourceDescriptor where the
ThreadContext parameter is ().
Required Associated Types§
Required Methods§
Sourceunsafe fn simple_exact_fetch_item(&self, index: usize) -> Self::Item
unsafe fn simple_exact_fetch_item(&self, index: usize) -> Self::Item
Fetch the item at the given index.
§Safety
Given the length len returned by len() in
SourceCleanup:
- indices passed to
simple_exact_fetch_item()must be in the0..lenrange, - each index in
0..lenmust be present at most once in all indices passed to calls tosimple_exact_fetch_item()and ranges passed to calls toSourceCleanup::cleanup_item_range().
It is therefore undefined behavior to call this function twice with the
same index, with an index contained in a range for which
cleanup_item_range() was
invoked, etc.
You normally shouldn’t have to worry about this, because this API is
intended to be called by Paralight’s internal multi-threading
engine. This API is public to allow others to implement parallel
sources: when implementing your own source(s), you can rely on these
unsafe pre-conditions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".