pub async fn new(config: Config) -> Result<Self, anyhow::Error> {
        // Initialize the portal
        let id_counter = Arc::new(AtomicUsize::new(1));
        let client_list = BTreeMap::new();
        let telnet_addr = config.telnet_addr().to_string();
        //let ws_addr = config.ws_addr().to_string();
        let (tx, rx) = mpsc::unbounded_channel();
        //TODO: Set portal start time

        Ok(Self {
            config,
            client_list,
            telnet_server: telnet::Server::new(&telnet_addr, id_counter.clone(), tx.clone())
                .await?,
            //ws_server: websockets::Server::new(&ws_addr, id_counter, tx).await?,
            rx,
        })
    }
/// Returns a new fully initialized `portal` server
///
/// # Arguments
///
/// * `config` - A Config structure, contains all necessary configuration
/// * 'rt' - The `tokio::runtime::Runtime` used to run the async I/O
///
/// # Errors
///
/// * Returns an error if the `Server` fails to initialize
Returns a new fully initialized `portal` server
Returns a new fully initialized ` portal ` server
pub async fn new(config: Config) -> Result<Self, anyhow::Error> {
        // Initialize the portal
        let id_counter = Arc::new(AtomicUsize::new(1));
        let client_list = BTreeMap::new();
        let telnet_addr = config.telnet_addr().to_string();
        //let ws_addr = config.ws_addr().to_string();
        let (tx, rx) = mpsc::unbounded_channel();
        //TODO: Set portal start time
        Ok(Self {
            config,
            client_list,
            telnet_server: telnet::Server::new(&telnet_addr, id_counter.clone(), tx.clone())
                .await?,
            //ws_server: websockets::Server::new(&ws_addr, id_counter, tx).await?,
            rx,
        })
    }
pub async fn new ( config : Config ) -> Result < Self , anyhow :: Error > { // Initialize the portal let id_counter = Arc :: new ( AtomicUsize :: new ( 1 ) ) ; let client_list = BTreeMap :: new ( ) ; let telnet_addr = config . telnet_addr ( ) . to_string ( ) ; //let ws_addr = config.ws_addr().to_string(); let ( tx , rx ) = mpsc :: unbounded_channel ( ) ; //TODO: Set portal start time Ok ( Self { config , client_list , telnet_server : telnet :: Server :: new ( & telnet_addr , id_counter . clone ( ) , tx . clone ( ) ) . await ? , //ws_server: websockets::Server::new(&ws_addr, id_counter, tx).await?, rx , } ) }
Returns a new fully initialized `portal` server
Returns a new fully initialized ` portal ` server
config
Config
errors
Returns an error if the `Server` fails to initialize
Returns an error if the ` Server ` fails to initialize