Skip to main content

SchedulerStreamBackend

Trait SchedulerStreamBackend 

Source
pub trait SchedulerStreamBackend {
    type Task: Debug;
    type Stream: Debug;
    type Factory: StreamFactory<Stream = Self::Stream>;

    // Required methods
    fn enqueue(task: Self::Task, stream: &mut Self::Stream);
    fn flush(stream: &mut Self::Stream);
    fn factory(&mut self) -> &mut Self::Factory;

    // Provided method
    fn requires_isolation(_stream: &Self::Stream) -> bool { ... }
}
Expand description

Defines a trait for a scheduler stream backend, specifying the types and behavior for task scheduling.

Required Associated Types§

Source

type Task: Debug

Type representing a task.

Source

type Stream: Debug

Type representing a stream.

Source

type Factory: StreamFactory<Stream = Self::Stream>

Type for the stream factory, which creates streams of type Self::Stream.

Required Methods§

Source

fn enqueue(task: Self::Task, stream: &mut Self::Stream)

Enqueues a task onto a given stream for execution.

Source

fn flush(stream: &mut Self::Stream)

Flush the inner stream queue to ensure ordering between different streams.

Source

fn factory(&mut self) -> &mut Self::Factory

Returns a mutable reference to the stream factory.

Provided Methods§

Source

fn requires_isolation(_stream: &Self::Stream) -> bool

Whether this stream currently requires its own tasks to execute on itself — no interleaving of its tasks onto another stream, and no other stream’s tasks onto it. While any stream involved in an execution requires isolation, the scheduler falls back to the sequential path. A graph capture engages this for its whole prepare → record window. Defaults to false.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§