pub fn to_config(self) -> Result<WsssConfig> {
    let addr_string: String = self.bind_address.unwrap_or(DEFAULT_BIND_ADDR.to_string());

    let ip_addr = Ipv4Addr::from_str(&addr_string)?;
    // .map_err(|e| ErrorKind::IpAddr(e).into())?;

    Ok(WsssConfig {
      http_port: self.http_port.unwrap_or(DEFAULT_HTTP_PORT),
      ws_port: self.ws_port.unwrap_or(DEFAULT_WS_PORT),
      bind_address: ip_addr,
    })
  }
/// Convert to a WsssConfig with default values
/// substituted for missing values
Convert to a WsssConfig with default values
substituted for missing values
Convert to a WsssConfig with default values substituted for missing values
pub fn to_config(self) -> Result<WsssConfig> {
    let addr_string: String = self.bind_address.unwrap_or(DEFAULT_BIND_ADDR.to_string());
    let ip_addr = Ipv4Addr::from_str(&addr_string)?;
    // .map_err(|e| ErrorKind::IpAddr(e).into())?;
    Ok(WsssConfig {
      http_port: self.http_port.unwrap_or(DEFAULT_HTTP_PORT),
      ws_port: self.ws_port.unwrap_or(DEFAULT_WS_PORT),
      bind_address: ip_addr,
    })
  }
pub fn to_config ( self ) -> Result < WsssConfig > { let addr_string : String = self . bind_address . unwrap_or ( DEFAULT_BIND_ADDR . to_string ( ) ) ; let ip_addr = Ipv4Addr :: from_str ( & addr_string ) ? ; // .map_err(|e| ErrorKind::IpAddr(e).into())?; Ok ( WsssConfig { http_port : self . http_port . unwrap_or ( DEFAULT_HTTP_PORT ) , ws_port : self . ws_port . unwrap_or ( DEFAULT_WS_PORT ) , bind_address : ip_addr , } ) }
Convert to a WsssConfig with default values
substituted for missing values
Convert to a WsssConfig with default values substituted for missing values
self
self