#![allow(unused)]
use std::fmt;
use std::rc::Rc;
pub const TEST1: &'static str = "ws://101.200.230.74:5020";
pub const TEST2: &'static str = "ws://192.168.208.130:5060";
pub const TEST3: &'static str = "ws://ts5.jingtum.com:5020";
pub struct Config {
pub addr: &'static str, pub local_sign: bool, }
impl Config {
pub fn new(addr: &'static str, local_sign: bool) -> Box<Rc<Self>> {
Box::new(Rc::new( Config {
addr: addr,
local_sign: local_sign,
} ))
}
pub fn default_with_box() -> Box<Rc<Self>> {
Box::new(Rc::new( Config::default() ))
}
}
impl Default for Config {
fn default() -> Self {
Config {
addr: TEST2,
local_sign: true,
}
}
}
impl fmt::Debug for Config {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Config {{ addr: {}, local_sign: {} }}", self.addr, self.local_sign)
}
}