diff options
| author | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-14 17:45:48 +0400 |
|---|---|---|
| committer | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-14 17:45:48 +0400 |
| commit | 3f342846149c0b1f8d1ac1f0b857a9d9fdf2034b (patch) | |
| tree | 5ad087639ade0998ec0af0e0532c71a59b92993a /libs/shared/src/nats.rs | |
| parent | ee58b30800527306ab024da926121c085a0978fa (diff) | |
clippy, tests and a bit of docs
Diffstat (limited to 'libs/shared/src/nats.rs')
| -rw-r--r-- | libs/shared/src/nats.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libs/shared/src/nats.rs b/libs/shared/src/nats.rs index 3529c46..7d4d3d1 100644 --- a/libs/shared/src/nats.rs +++ b/libs/shared/src/nats.rs @@ -4,23 +4,12 @@ use async_nats::Client; use serde::Deserialize; #[derive(Clone, Debug, Deserialize)] -pub struct NatsConfigurationClientCert { - pub cert: String, - pub key: String, -} - -#[derive(Clone, Debug, Deserialize)] -pub struct NatsConfigurationTls { - pub mtu: Option<usize>, -} - -#[derive(Clone, Debug, Deserialize)] -pub struct NatsConfiguration { +pub struct Configuration { pub host: String, } -impl From<NatsConfiguration> for Pin<Box<dyn Future<Output = anyhow::Result<Client>> + Send>> { - fn from(value: NatsConfiguration) -> Self { +impl From<Configuration> for Pin<Box<dyn Future<Output = anyhow::Result<Client>> + Send>> { + fn from(value: Configuration) -> Self { Box::pin(async move { Ok(async_nats::connect(value.host).await?) }) } } |
