| Crates.io | safelyx |
| lib.rs | safelyx |
| version | 0.1.1 |
| created_at | 2025-03-07 09:38:27.787195+00 |
| updated_at | 2025-03-07 09:40:12.957422+00 |
| description | Safelyx Rust SDK |
| homepage | https://safelyx.com |
| repository | https://github.com/safelyx/safelyx-rust |
| max_upload_size | |
| id | 1582571 |
| size | 54,145 |
Safelyx API client
Safelyx API client for Rust.
You can find the API documentation at https://safelyx.com/safe-api.
It's simply making an HTTP request to the Safelyx API.
It's using the reqwest library to make the HTTP request.
If the request to the API fails, it will return a Result with an error, so you can handle it using Rust's error handling patterns.
It has a method per API endpoint.
use safelyx;
fn main() {
let check_result = safelyx::check_link("https://example.com", "your-key-code")
.expect("Failed to check link");
println!("{}", check_result.result); // Outputs a safety score between 0 (unsafe) and 10 (safe). -1 if there was an error, -2 if there are no checks remaining.
}
Add this to your Cargo.toml:
[dependencies]
safelyx = "0.1"
Requires Rust 1.70+.
make install
make format
make test
After committing and pushing with a new version in Cargo.toml, just run:
make publish