dagger-rs/crates/dagger-core/src/connect_params.rs

21 lines
433 B
Rust
Raw Normal View History

2023-01-27 21:57:39 +01:00
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct ConnectParams {
pub port: u64,
pub session_token: String,
}
impl ConnectParams {
pub fn new(port: u64, session_token: &str) -> Self {
Self {
port,
session_token: session_token.to_string(),
}
}
pub fn url(&self) -> String {
format!("http://127.0.0.1:{}/query", self.port)
}
}