Skip to main content

Background

Trait Background 

Source
pub trait Background: Send + Sync {
    // Required methods
    fn spawn(&self, task: BoxFuture<'static, ()>) -> bool;
    fn sleep(&self, pause: Duration) -> BoxFuture<'static, ()>;
}
Expand description

Where the preview’s background asking runs, and how it waits between tries.

Required Methods§

Source

fn spawn(&self, task: BoxFuture<'static, ()>) -> bool

Runs task in the background; false when there is nowhere to run it — a unit test rendering a page outside a runtime.

Source

fn sleep(&self, pause: Duration) -> BoxFuture<'static, ()>

Waits pause.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§