PromRequest

Trait PromRequest 

Source
pub trait PromRequest: Serialize {
    type Output<KV: Clone + Debug + DeserializeOwned>: Clone + Debug + DeserializeOwned;

    const PATH: &str;

    // Provided methods
    fn send<'life0, 'life1, 'async_trait, KV>(
        &'life0 self,
        host: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output<KV>, Error>> + Send + 'async_trait>>
       where KV: Clone + Debug + DeserializeOwned + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn send_with_client<'life0, 'life1, 'life2, 'async_trait, KV>(
        &'life0 self,
        client: &'life1 Client,
        host: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output<KV>, Error>> + Send + 'async_trait>>
       where KV: Clone + Debug + DeserializeOwned + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Trait for types that can be sent as Prometheus API requests

Required Associated Constants§

Source

const PATH: &str

The API path for this request type (e.g., “/api/v1/query”)

Required Associated Types§

Source

type Output<KV: Clone + Debug + DeserializeOwned>: Clone + Debug + DeserializeOwned

The output type returned by this request

Provided Methods§

Source

fn send<'life0, 'life1, 'async_trait, KV>( &'life0 self, host: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::Output<KV>, Error>> + Send + 'async_trait>>
where KV: Clone + Debug + DeserializeOwned + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send the request to the given prometheus host URL

Source

fn send_with_client<'life0, 'life1, 'life2, 'async_trait, KV>( &'life0 self, client: &'life1 Client, host: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Self::Output<KV>, Error>> + Send + 'async_trait>>
where KV: Clone + Debug + DeserializeOwned + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send the request using the provided reqwest client

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§