Expand description
§Compute Environment Detector
This library provides two functions for easily detecting a ComputeEnvironment based on a
given weighted threshold.
§Examples
use apollo_environment_detector::{detect, detect_one, MAX_INDIVIDUAL_WEIGHTING};
// Attempt to detect multiple environments based on a weighting.
let compute_envs = detect(MAX_INDIVIDUAL_WEIGHTING);
println!("{:?}", compute_envs);
// Attempt to detect a single environment based on a weighting.
let compute_env = detect_one(MAX_INDIVIDUAL_WEIGHTING);
println!("{:?}", compute_env);Enums§
- Cloud
Provider - Supported cloud providers that can be detected by this crate.
- Compute
Environment - Supported compute environments that can be detected by this crate
Constants§
- MAX_
INDIVIDUAL_ WEIGHTING - Represents the maximum individual detector weighting.
- MAX_
TOTAL_ WEIGHTING - Represents the maximum weighting of all supported detectors (
2^15).
Functions§
- detect
- Detect potential
ComputeEnvironments above a certain weighted threshold. - detect_
one - Detect a single, most likely
ComputeEnvironmentabove a certain weighted threshold.