EventStreamBackend

Trait EventStreamBackend 

Source
pub trait EventStreamBackend: 'static {
    type Stream: Debug;
    type Event: Send + 'static;

    // Required methods
    fn create_stream(&self) -> Self::Stream;
    fn flush(stream: &mut Self::Stream) -> Self::Event;
    fn wait_event(stream: &mut Self::Stream, event: Self::Event);
    fn wait_event_sync(event: Self::Event);
}
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§

Source

type Stream: Debug

The type representing a stream in this backend.

Source

type Event: Send + 'static

The type representing an event in this backend.

Required Methods§

Source

fn create_stream(&self) -> Self::Stream

Initializes and returns a new stream associated with the given stream ID.

Source

fn flush(stream: &mut Self::Stream) -> Self::Event

Flushes the given stream, ensuring all pending operations are submitted, and returns an event that can be used for synchronization.

Source

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.

Source

fn wait_event_sync(event: Self::Event)

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", so this trait is not object safe.

Implementors§