{"id":17800775,"url":"https://github.com/kiwiyou/craftping","last_synced_at":"2025-04-09T12:02:43.648Z","repository":{"id":55404836,"uuid":"177273906","full_name":"kiwiyou/craftping","owner":"kiwiyou","description":"Minecraft Server List Ping in Rust","archived":false,"fork":false,"pushed_at":"2025-03-17T17:46:14.000Z","size":63,"stargazers_count":36,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T10:05:33.529Z","etag":null,"topics":["minecraft","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwiyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-23T10:14:11.000Z","updated_at":"2025-03-17T17:43:10.000Z","dependencies_parsed_at":"2025-03-26T10:00:34.695Z","dependency_job_id":"d714dea6-3663-486d-b1f0-28a780167a41","html_url":"https://github.com/kiwiyou/craftping","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":0.3421052631578947,"last_synced_commit":"a0da36d618a7def7de6b30c1e7c7adb122469483"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2Fcraftping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2Fcraftping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2Fcraftping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2Fcraftping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwiyou","download_url":"https://codeload.github.com/kiwiyou/craftping/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036060,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["minecraft","rust"],"created_at":"2024-10-27T12:28:32.057Z","updated_at":"2025-04-09T12:02:43.572Z","avatar_url":"https://github.com/kiwiyou.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# craftping [![crates.io](https://img.shields.io/crates/v/craftping.svg)](https://crates.io/crates/craftping) [![docs.rs](https://docs.rs/craftping/badge.svg)](https://docs.rs/craftping) ![license](https://img.shields.io/github/license/kiwiyou/craftping.svg) [![Actively Maintained](https://img.shields.io/badge/Maintenance%20Level-Actively%20Maintained-green.svg)](https://github.com/kiwiyou/craftping)\n\ncraftping is a Rust library to ping Minecraft Servers.\n\n## Usage\n\n```toml\n[dependencies]\ncraftping = \"0.7.0\"\n```\n\nYou can synchronously ping to the server with `craftping::sync::ping`:\n\n```rust\nuse std::net::TcpStream;\nuse craftping::sync::ping;\n\nfn main() {\n    let hostname = \"localhost\";\n    let port = 25565;\n    let mut stream = TcpStream::connect((hostname, port)).unwrap();\n    let pong = ping(\u0026mut stream, hostname, port).expect(\"Cannot ping server\");\n    println!(\"Ping result: {:?}\", pong);\n}\n```\n\n`sync` module requires `sync` feature, which is enabled by default.\n\nIf you want to send pings asynchronously, you can use `craftping::tokio::ping` or `craftping::futures::ping`:\n\n- `craftping::tokio::ping`\n\n```rust\nuse tokio::net::TcpStream;\nuse craftping::tokio::ping;\n\n#[tokio::main]\nasync fn main() {\n    let hostname = \"localhost\";\n    let port = 25565;\n    let mut stream = TcpStream::connect((hostname, port)).await.unwrap();\n    let pong = ping(\u0026mut stream, hostname, port).await.expect(\"Cannot ping server\");\n    println!(\"Ping result: {:?}\", pong);\n}\n```\n\n- `craftping::futures::ping`\n\n```rust\nuse async_std::net::TcpStream;\nuse craftping::futures::ping;\n\n#[async_std::main]\nasync fn main() {\n    let hostname = \"localhost\";\n    let port = 25565;\n    let mut stream = TcpStream::connect((hostname, port)).await.unwrap();\n    let pong = ping(\u0026mut stream, hostname, port).await.expect(\"Cannot ping server\");\n    println!(\"Ping result: {:?}\", pong);\n}\n```\n\nNote that `tokio` module requires `async-tokio` feature and `futures` `async-futures`.\n\nCheck [here](https://wiki.vg/Server_List_Ping#Response) for more information about ping result.\n\n## Contributing\n\nPull requests are welcome. For major issues, please open the issue on this repository first.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwiyou%2Fcraftping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwiyou%2Fcraftping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwiyou%2Fcraftping/lists"}