pub fn from_file(path: &Path) -> Result<Self, String> {
        match fs::read_to_string(path) {
            Ok(content) => Self::from_str_ip(content.trim()),
            Err(err) => Err(format!("Error while reading {}: {}", path.display(), err)),
        }
    }
/// Parse server info (IP) from a file and return new Client.
///
/// # Arguments
///
/// * `path` - path to the file with client info.
///
/// # Errors
///
/// An error is returned if file couldn't be successfully read or if
/// its contents can't be parsed.
Parse server info (IP) from a file and return new Client.
Parse server info ( IP ) from a file and return new Client .
pub fn from_file(path: &Path) -> Result<Self, String> {
        match fs::read_to_string(path) {
            Ok(content) => Self::from_str_ip(content.trim()),
            Err(err) => Err(format!("Error while reading {}: {}", path.display(), err)),
        }
    }
pub fn from_file ( path : & Path ) -> Result < Self , String > { match fs :: read_to_string ( path ) { Ok ( content ) => Self :: from_str_ip ( content . trim ( ) ) , Err ( err ) => Err ( format ! ( " " path display ( ) err ) ) , } }
Parse server info (IP) from a file and return new Client.
Parse server info ( IP ) from a file and return new Client .
path
&Path
path
&Path
errors
An error is returned if file couldn't be successfully read or if
its contents can't be parsed.
An error is returned if file couldn ' t be successfully read or if its contents can ' t be parsed .