Function cloud_detect::try_detect

source ·
pub async fn try_detect(timeout: Option<u64>) -> Result<String, Box<dyn Error>>
Expand description

Attempts to detect the current host’s cloud service provider. If we encounter an error, we return it rather than unwrapping or assuming the provider as “unknown”.

NOTE: This also means that this function returns an error if the current host’s provider is unsupported.

Arguments

  • timeout - How long to attempt detection for (in seconds). Defaults to 3 seconds.