crypto_botters_api/
lib.rs1use std::fmt::Debug;
5
6pub trait HandlerOption: Default {
8 type Options: HandlerOptions<OptionItem=Self>;
9}
10
11pub trait HandlerOptions: Default + Clone + Debug {
13 type OptionItem: HandlerOption<Options=Self>;
15
16 fn update(&mut self, option: Self::OptionItem);
17}
18
19pub trait HttpOption<'a, R>: HandlerOption {
21 type RequestHandler;
22
23 fn request_handler(options: Self::Options) -> Self::RequestHandler;
24}
25
26pub trait WebSocketOption<H>: HandlerOption {
28 type WebSocketHandler;
29
30 fn websocket_handler(handler: H, options: Self::Options) -> Self::WebSocketHandler;
31}