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§
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 flush(stream: &mut Self::Stream) -> Self::Event
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.
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)
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.