Skip to main content

register

Function register 

Source
pub fn register(
    engine: &Engine,
    container: &str,
    harness: HarnessKind,
    token: &str,
) -> Result<(), Unregistered>
Expand description

Registers the server in the settings of harness inside the running container container, whose home is the workspace’s home volume for the profile. token is the tab’s, for the one harness whose entry carries it instead of its container’s environment.

The file is read and written by a shell in the container, because a volume is only reached through a container, and the new text goes through the shell’s input, because a harness’s settings can be longer than one argument may be. It is written beside the old file with the old file’s mode and moved over it, so a harness reading at that moment finds the old file or the new one, never half of one. Runs engine commands, so it belongs on a background thread.

§Errors

Unregistered when the file holds a server of the same name, cannot be read as its format, or the engine refuses.