Skip to main content

refresh_all

Function refresh_all 

Source
pub fn refresh_all(
    engine: &Engine,
    profile: &SafeName,
    workspaces: &[WorkspaceId],
    user: HostUser,
) -> Result<Refreshed, RefreshError>
Expand description

Writes profile’s stored login into the home of every workspace in workspaces that is not running the profile right now, and says which were written and which were left.

A workspace whose container for the profile is running is skipped rather than stopped. A running container is a harness someone may be in the middle of using; stopping it would end that work unasked, and rewriting the login under it would leave the harness holding one it no longer has. Skipping loses nothing: the person stops the container from the workspace screen and refreshes again, and the copy that was there stays whole in the meantime.

The first workspace the engine refuses ends the round; what was written before it stays written.

§Errors

RefreshError::NotStored when the profile has no login, before anything is touched; RefreshError::Engine when the engine cannot be asked or refuses a copy.