Skip to main content

current_session

Function current_session 

Source
pub fn current_session() -> Arc<Session> 
Expand description

The session THIS work belongs to.

A task bound by spawn_bound gets the account it started under, for its whole life, however many awaits it spans and whoever logs in meanwhile. That is the property the std::sync::Arccrate::db::Session checks were approximating by hand.

Unbound callers (startup, the UI command that performs the swap itself) get the live account, which for them is the correct and only meaningful answer.