pub trait EventStreamBackend: 'static {
type Stream: Debug + StreamMemory;
type Event: Send + 'static;
// Required methods
fn create_stream(&self) -> Self::Stream;
fn handle_cursor(stream: &Self::Stream, handle: &BufferBinding) -> u64;
fn flush(
stream: &mut Self::Stream,
failures: &mut ErrorGraph,
) -> Self::Event;
fn wait_event(stream: &mut Self::Stream, event: Self::Event);
fn wait_event_sync(event: Self::Event) -> Result<(), ServerError>;
}Expand description
Trait defining the backend operations for managing streams and events.
This trait provides the necessary methods for initializing streams, flushing them to create events, and waiting on events for synchronization purposes.
Required Associated Types§
Sourcetype Stream: Debug + StreamMemory
type Stream: Debug + StreamMemory
The type representing a stream in this backend, which exposes the
memory its kernels see through StreamMemory.
Required Methods§
Sourcefn create_stream(&self) -> Self::Stream
fn create_stream(&self) -> Self::Stream
Initializes and returns a new stream associated with the given stream ID.
Sourcefn handle_cursor(stream: &Self::Stream, handle: &BufferBinding) -> u64
fn handle_cursor(stream: &Self::Stream, handle: &BufferBinding) -> u64
Returns the cursor of the given handle on the given stream.
Sourcefn flush(stream: &mut Self::Stream, failures: &mut ErrorGraph) -> Self::Event
fn flush(stream: &mut Self::Stream, failures: &mut ErrorGraph) -> Self::Event
Flushes the given stream, ensuring all pending operations are submitted, and returns an event that can be used for synchronization.
failures is the device’s failure store, handed down because a flush
may drive the stream’s periodic memory cleanup, and cleaning up is
where a pool sheds the failures its slices carry.
Sourcefn wait_event(stream: &mut Self::Stream, event: Self::Event)
fn wait_event(stream: &mut Self::Stream, event: Self::Event)
Makes the stream wait for the specified event to complete before proceeding with further operations.
Sourcefn wait_event_sync(event: Self::Event) -> Result<(), ServerError>
fn wait_event_sync(event: Self::Event) -> Result<(), ServerError>
Wait for the given event synching the CPU.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".