mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-20 06:00:06 +08:00
15 lines
405 B
Rust
15 lines
405 B
Rust
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
pub trait DiscoveryContext {
|
|
fn env_var(&self, key: &str) -> Option<String>;
|
|
}
|
|
|
|
pub struct RealDiscoveryContext;
|
|
|
|
impl DiscoveryContext for RealDiscoveryContext {
|
|
fn env_var(&self, key: &str) -> Option<String> {
|
|
std::env::var(key).ok()
|
|
}
|
|
}
|