rama_proxy/proxydb/
context.rs

1use rama_net::transport::{TransportContext, TransportProtocol};
2
3/// The context as relevant to the proxy layer.
4#[derive(Debug, Clone)]
5pub struct ProxyContext {
6    /// The transport protocol used by the proxy.
7    pub protocol: TransportProtocol,
8}
9
10impl From<TransportContext> for ProxyContext {
11    fn from(ctx: TransportContext) -> Self {
12        Self {
13            protocol: ctx.protocol,
14        }
15    }
16}
17
18impl From<&TransportContext> for ProxyContext {
19    fn from(ctx: &TransportContext) -> Self {
20        Self {
21            protocol: ctx.protocol,
22        }
23    }
24}