Skip to main content

current_set_scope

Function current_set_scope 

Source
pub fn current_set_scope() -> Option<SetScopeId>
Expand description

The SetScope of the conditional Foo/set method running on this task, or None outside one.

Every backend call made while this is Some(scope) belongs to that scope: its reads see the scope’s writes and its writes commit or roll back with it. Task-locals do not cross tokio::spawn, so a backend that spawns work must read the id first and carry it.