torznab_toolkit/
lib.rs

1//! Links:
2//! - **[Tutorial](notes::tutorial)**
3//! - [Minor implementation and usage notes](notes::notes)
4#![warn(missing_docs)]
5#![doc = include_str!("../README.md")]
6pub(crate) mod api;
7pub mod data;
8mod dummy;
9
10use rocket;
11// imports for docs
12use crate::data::Config;
13
14/// Runs the server
15///
16/// Returns `Ok(true)` if it succeeds, otherwise returns the error from Rocket
17pub async fn run(conf: data::Config) -> Result<bool, rocket::Error> {
18    match rocket::build()
19        .mount(
20            "/",
21            rocket::routes![
22                api::caps,
23                api::search,
24                api::tv_search,
25                api::movie_search,
26                api::music_search,
27                api::book_search
28            ],
29        )
30        .manage(conf)
31        .launch()
32        .await
33    {
34        Ok(_) => {
35            return Ok(true);
36        }
37        Err(e) => {
38            return Err(e);
39        }
40    }
41}
42
43/// Notes regarding the usage of torznab-toolkit and how it implements the Torznab API.
44pub mod notes;