mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-24 06:58:22 -05:00
fixing documentation test in lib.rs and adding library documentation
This commit is contained in:
parent
3481ec4354
commit
cb1edad658
@ -1,3 +1,6 @@
|
|||||||
|
//! This main library module provides the functionality to provide and handle the Tcp server
|
||||||
|
//! and register all the routes for the `websurfx` meta search engine website.
|
||||||
|
|
||||||
pub mod engines;
|
pub mod engines;
|
||||||
pub mod server;
|
pub mod server;
|
||||||
pub mod search_results_handler;
|
pub mod search_results_handler;
|
||||||
@ -23,12 +26,12 @@ use handlebars::Handlebars;
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```rust
|
||||||
/// use std::net::TcpListener;
|
/// use std::net::TcpListener;
|
||||||
/// use web_server::Server;
|
/// use websurfx::run;
|
||||||
///
|
///
|
||||||
/// let listener = TcpListener::bind("127.0.0.1:8080").expect("Failed to bind address");
|
/// let listener = TcpListener::bind("127.0.0.1:8080").expect("Failed to bind address");
|
||||||
/// let server = Server::run(listener).expect("Failed to start server");
|
/// let server = run(listener).expect("Failed to start server");
|
||||||
/// ```
|
/// ```
|
||||||
pub fn run(listener: TcpListener) -> std::io::Result<Server> {
|
pub fn run(listener: TcpListener) -> std::io::Result<Server> {
|
||||||
let mut handlebars: Handlebars = Handlebars::new();
|
let mut handlebars: Handlebars = Handlebars::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user