gsm-core 0.4.33

Core types and platform abstractions for the Greentic messaging runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use async_trait::async_trait;
use bytes::Bytes;
use http::{HeaderMap, Request, StatusCode};

#[derive(Debug, Clone)]
pub struct RawResponse {
    pub status: StatusCode,
    pub headers: HeaderMap,
    pub body: Bytes,
}

pub type RawRequest = Request<Bytes>;

#[async_trait]
pub trait HttpClient: Send + Sync {
    async fn execute(&self, request: Request<Bytes>) -> Result<RawResponse>;
}