//! Web request handlers

use rustelo_core::Result;

/// Request handler trait
pub trait Handler {
    /// Handle request
    fn handle(&self, request: &str) -> impl std::future::Future<Output = Result<String>> + Send;
}

/// Example handler
pub struct ExampleHandler;

impl Handler for ExampleHandler {
    fn handle(&self, request: &str) -> impl std::future::Future<Output = Result<String>> + Send {
        let request = request.to_string();
        async move { Ok(format!("Handled: {}", request)) }
    }
}
