saluki_env/host/
mod.rs

1//! Host provider.
2//!
3//! This module provides the `HostProvider` trait, which deals with providing information about the process host itself.
4//!
5//! A default host provider implementation, based on the Datadog Agent, is included.
6
7pub mod providers;
8
9use async_trait::async_trait;
10use saluki_error::GenericError;
11
12/// Provides information about the process host itself.
13#[async_trait]
14pub trait HostProvider {
15    /// Errors produced by the provider.
16    type Error: Into<GenericError>;
17
18    /// Gets the hostname of the process host.
19    ///
20    /// # Errors
21    ///
22    /// If an error occurs while querying the hostname, an error is returned.
23    async fn get_hostname(&self) -> Result<String, Self::Error>;
24}