Trait drone_core::thread::Thread [] [src]

pub trait Thread: Sized + Sync + 'static {
    fn all() -> *mut [Self];
fn routines(&self) -> &RoutineStack;
fn routines_mut(&mut self) -> &mut RoutineStack;
fn task(&self) -> &TaskCell;
fn preempted(&mut self) -> &mut usize; fn routine<G>(&self, g: G)
    where
        G: Generator<Yield = (), Return = ()>,
        G: Send + 'static
, { ... }
fn routine_fn<F>(&self, f: F)
    where
        F: FnOnce(),
        F: Send + 'static
, { ... }
fn future<G, T, E>(&self, g: G) -> RoutineFuture<T, E>
    where
        G: Generator<Yield = (), Return = Result<T, E>>,
        G: Send + 'static,
        T: Send + 'static,
        E: Send + 'static
, { ... }
fn future_fn<F, T, E>(&self, f: F) -> RoutineFuture<T, E>
    where
        F: FnOnce() -> Result<T, E>,
        F: Send + 'static,
        T: Send + 'static,
        E: Send + 'static
, { ... }
fn stream<G, E, O>(&self, overflow: O, g: G) -> RoutineStreamUnit<E>
    where
        G: Generator<Yield = Option<()>, Return = Result<Option<()>, E>>,
        O: Fn() -> Result<(), E>,
        G: Send + 'static,
        E: Send + 'static,
        O: Send + 'static
, { ... }
fn stream_skip<G, E>(&self, g: G) -> RoutineStreamUnit<E>
    where
        G: Generator<Yield = Option<()>, Return = Result<Option<()>, E>>,
        G: Send + 'static,
        E: Send + 'static
, { ... }
fn stream_ring<G, T, E, O>(
        &self,
        capacity: usize,
        overflow: O,
        g: G
    ) -> RoutineStreamRing<T, E>
    where
        G: Generator<Yield = Option<T>, Return = Result<Option<T>, E>>,
        O: Fn(T) -> Result<(), E>,
        G: Send + 'static,
        T: Send + 'static,
        E: Send + 'static,
        O: Send + 'static
, { ... }
fn stream_ring_skip<G, T, E>(
        &self,
        capacity: usize,
        g: G
    ) -> RoutineStreamRing<T, E>
    where
        G: Generator<Yield = Option<T>, Return = Result<Option<T>, E>>,
        G: Send + 'static,
        T: Send + 'static,
        E: Send + 'static
, { ... }
fn stream_ring_overwrite<G, T, E>(
        &self,
        capacity: usize,
        g: G
    ) -> RoutineStreamRing<T, E>
    where
        G: Generator<Yield = Option<T>, Return = Result<Option<T>, E>>,
        G: Send + 'static,
        T: Send + 'static,
        E: Send + 'static
, { ... } }

A thread interface.

Required Methods

Returns a mutable pointer to the static array of threads.

Returns a reference to the routines stack.

Returns a mutable reference to the routines stack.

Returns the cell for the task pointer.

Returns a mutable reference to the stored index of the preempted thread.

Provided Methods

Adds a new routine to the stack. This method accepts a generator.

Adds a new routine to the stack. This method accepts a closure.

Adds a new routine to the stack. Returns a Future of the routine's return value. This method accepts a generator.

Adds a new routine to the stack. Returns a Future of the routine's return value. This method accepts a closure.

Adds a new routine to the stack. Returns a Stream of routine's yielded values. If overflow returns Ok(()), current value will be skipped. This method only accepts () as values.

Adds a new routine to the stack. Returns a Stream of routine's yielded values. Values will be skipped on overflow. This method only accepts () as values.

Adds a new routine to the stack. Returns a Stream of routine's yielded values. If overflow returns Ok(()), currenct value will be skipped.

Adds a new routine to the stack. Returns a Stream of routine's yielded values. New values will be skipped on overflow.

Adds a new routine to the stack. Returns a Stream of routine's yielded values. Old values will be overwritten on overflow.

Implementors