sheldond/src/server/mod.rs

30 lines
544 B
Rust

use std::vec::Vec;
use std::collections::HashMap;
use url::Url;
mod handler;
mod response;
pub struct Server {
handlers: Vec<Box<dyn handler::Handler>>,
}
impl Server {
pub fn new() -> Server {
Server{handlers: Vec::<Box<dyn handler::Handler>>::new()}
}
}
pub fn register(host: &str, server: Server) {
//// servers.insert(
//// host.to_string(),
//// server,
//// );
}
pub fn handle(url: &Url) -> Vec<u8> {
return Vec::new();
}
//static mut servers : HashMap<String, Server> = HashMap::new();