Handler

Trait Handler 

Source
pub trait Handler {
    // Required method
    fn handle_request(&self, key: &str) -> Option<String>;
}
Expand description

A trait for handling requests based on a key.

This trait provides a mechanism for handling requests by taking a key and returning an associated value wrapped in an Option.

Required Methods§

Source

fn handle_request(&self, key: &str) -> Option<String>

Handles a request based on the provided key.

§Arguments
  • key - The key associated with the request.
§Returns

An Option wrapping a String value associated with the key. If there’s no value associated with the key, it should return None.

Implementors§