Menu

Struct

SecondInstance

kurogane::SecondInstanceSource
pub struct SecondInstance { /* private fields */ }

A launch of the application while another instance is already running.

Chromium allows one instance per profile. The new launch passes its arguments and working directory to the running instance and exits.

Passed to the closure given to App::on_second_instance.

Methods

#pub fn args(&self) -> &[String]

Returns the launch arguments that are not switches.

The arguments contain the files or links named by the launch, in order. The program name is not included.

#pub fn switch(&self, name: &str) -> Option<&str>

Returns the value of the --name switch.

Returns an empty string when the switch has no value and None when the switch was not present.

#pub fn working_dir(&self) -> Option<&Path>

The directory the launch was started in, which the relative paths among its arguments are relative to.

Trait implementations