graft_client/
pair.rs

1use crate::{MetastoreClient, PagestoreClient};
2
3/// Convenience struct wrapping a pair of `MetastoreClient` and `PagestoreClient`
4#[derive(Debug, Clone)]
5pub struct ClientPair {
6    metastore: MetastoreClient,
7    pagestore: PagestoreClient,
8}
9
10impl ClientPair {
11    pub fn new(metastore: MetastoreClient, pagestore: PagestoreClient) -> Self {
12        Self { metastore, pagestore }
13    }
14
15    #[cfg(test)]
16    pub fn test_empty() -> Self {
17        use crate::NetClient;
18        Self {
19            metastore: MetastoreClient::new(
20                "invalid://foo:0".parse().unwrap(),
21                NetClient::new(None),
22            ),
23            pagestore: PagestoreClient::new(
24                "invalid://foo:0".parse().unwrap(),
25                NetClient::new(None),
26            ),
27        }
28    }
29
30    pub fn metastore(&self) -> &MetastoreClient {
31        &self.metastore
32    }
33
34    pub fn pagestore(&self) -> &PagestoreClient {
35        &self.pagestore
36    }
37}