pub struct DefaultHandler { /* private fields */ }
Expand description
A default implementation of the Handler
trait.
This struct contains a single value
that will be returned for any request,
regardless of the provided key.
§Examples
use cor_args::{DefaultHandler, Handler};
// Create a new DefaultHandler for a specific value
let handler = DefaultHandler::new("some_value");
// Add a fallback handler
//let handler = handler.next(some_other_handler.into());
// Handle a configuration request
let value = handler.handle_request("some_key");
Implementations§
Trait Implementations§
Source§impl Handler for DefaultHandler
impl Handler for DefaultHandler
Auto Trait Implementations§
impl Freeze for DefaultHandler
impl RefUnwindSafe for DefaultHandler
impl Send for DefaultHandler
impl Sync for DefaultHandler
impl Unpin for DefaultHandler
impl UnwindSafe for DefaultHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more