Skip to main content

install_default

Function install_default 

Source
pub fn install_default()
Expand description

Install the global defaults provided by the facade crate.

This function is safe to call multiple times. It registers enabled services and installs the default HTTP transport when the corresponding feature is enabled.

ยงProcess-wide HTTP transport

When auto-register-services is enabled, a process constructor calls this function before main. If a default HTTP transport feature is also enabled, that transport occupies the process-wide default because HttpTransporter::install_default uses first-installed-wins semantics.

Applications that need to install their own process-wide transport should disable auto-register-services, call init_default_registry explicitly when URI-based construction is needed, and install the transport themselves. Per-operator transports can be configured regardless of this setting.