To search for a torrent, simply use the search_l337x function
``` use torrentsearch::{searchl337x, TorrentSearchResult, TorrentSearchError}; let debiansearchresults = searchl337x("Debian ISO".tostring()).unwrap();
for result in debiansearchresults { println!("Name of torrent: {}\nMagnet: {}\nSeeders: {}\nLeeches: {}", result.name, result.magnet.unwrap(), result.seeders.unwrap(), result.leeches.unwrap()); }
```
This will return Result<Vec<TorrentSearchResult>, TorrentSearchError>
, which when unwrapped
gives a Vector of TorrentSearchResults (shocking I know).
You can view more information about the data types of the structs here