use std::net::SocketAddr;
#[derive(Debug, Clone)]
pub struct ConsoleConfig {
pub bind_addr: SocketAddr,
}
impl Default for ConsoleConfig {
fn default() -> Self {
Self { bind_addr: ([127, 0, 0, 1], 6669).into() }
}
}
impl ConsoleConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_bind_addr(mut self, bind_addr: SocketAddr) -> Self {
self.bind_addr = bind_addr;
self
}
}
pub struct TokioConsole;
impl TokioConsole {
pub fn new() -> Self {
Self
}
pub fn init(&self, config: &ConsoleConfig) {
tracing::info!("Tokio console initialized on {}", config.bind_addr);
}
}
impl Default for TokioConsole {
fn default() -> Self {
Self::new()
}
}