Skip to main content

BackgroundActivity

Trait BackgroundActivity 

Source
pub trait BackgroundActivity: Send + Sync {
    // Required method
    fn set_active(&self, active: bool);
}
Expand description

Marks periods of important work so the platform grants background running time. Implementations are Send + Sync (the app toggles activity from its worker threads).

Required Methods§

Source

fn set_active(&self, active: bool)

true when important work starts, false when it finishes. Calls are balanced by the app but implementations must tolerate repeats.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§