Skip to main content

SimpleExactSourceDescriptor

Trait SimpleExactSourceDescriptor 

Source
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§

Source

type Item

The type of items that this parallel source produces.

Required Methods§

Source

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:

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".

Implementors§