[][src]Trait scoped_spawn::RawScopedSpawn

The low-level trait for spawning tasks in a scope.

Associated Types

type CancelReceiver: SignalReceiver + Send

The type of the signal receiver for children to receive cancellation signals.

type DoneSender: SignalSender + Send

The type of the signal sender for children to signal their termination.

type CancelSenderWithSignal: ForgettableSignalSender + Send

The type of the signal sender for parents to initiate task termination, when using spawn_raw_with_signal.

type DoneReceiverWithSignal: SignalReceiver + Send

The type of the signal receiver for parents to wait for task termination, when using spawn_raw_with_signal.

type CancelReceiverWithSignal: SignalReceiver + Send

The type of the signal receiver for children to receive cancellation signals, when using spawn_raw_with_signal.

type DoneSenderWithSignal: SignalSender + Send

The type of the signal sender for children to signal their termination, when using spawn_raw_with_signal.

Loading content...

Required methods

fn spawn_raw(&self) -> ChildSignals<Self::CancelReceiver, Self::DoneSender>

Creates signals to be used by a child task.

The child task should start termination whenever a signal is sent to CancelReceiver. For example, the task could poll CancelReceiver at every yield point.

The child task should send a signal from DoneSender after its own children tasks are terminated.

fn spawn_raw_with_signal(
    &self
) -> (ParentSignals<Self::CancelSenderWithSignal, Self::DoneReceiverWithSignal>, ChildSignals<Self::CancelReceiverWithSignal, Self::DoneSenderWithSignal>)

Creates signals to be used by a child task.

CancelSenderWithSignal sends a signal to CancelReceiverWithSignal, and DoneReceiverWithSignal receives the signal from DoneSenderWithSignal. These signals exist in addition to the signals managed by this library for structured concurrency.

The child task should start termination whenever a signal is sent to CancelReceiverWithSignal. For example, the task could poll CancelReceiverWithSignal at every yield point.

The child task should send a signal from DoneSenderWithSignal after its own children tasks are terminated.

Loading content...

Implementors

Loading content...