mc-ping 0.0.20

Simple Java Minecraft Server Pinger
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![crate_type = "rlib"]

#[doc = include_str!("../README.md")]

pub mod connection;
pub mod packets;
mod varint;
pub mod mc_text;

#[tokio::test]
async fn test_localhost() -> anyhow::Result<()> {
    use crate::connection::Connection;
    let mut conn = Connection::new(("127.0.0.1".to_string(), 25565));
    conn = conn.timeout(7000)?.connect().await?;
    let status = conn.ping().await.unwrap();
    println!("{:?}", status);
    Ok(())
}