-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from negi-grass/restructure
Restructure
- Loading branch information
Showing
20 changed files
with
631 additions
and
295 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "crypto-botters-api" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//! This crate is meant to be used by the `crypto-botters` crate. | ||
//! This crate only exists to prevent cyclic dependencies. | ||
use std::fmt::Debug; | ||
|
||
/// A `trait` that represents an option which can be set when creating handlers | ||
pub trait HandlerOption: Default { | ||
type Options: HandlerOptions<OptionItem=Self>; | ||
} | ||
|
||
/// Set of [HandlerOption] s | ||
pub trait HandlerOptions: Default + Clone + Debug { | ||
/// The element of this set | ||
type OptionItem: HandlerOption<Options=Self>; | ||
|
||
fn update(&mut self, option: Self::OptionItem); | ||
} | ||
|
||
/// A `trait` that shows the implementing type is able to create [generic_api_client::http::RequestHandler]s | ||
pub trait HttpOption<'a, R>: HandlerOption { | ||
type RequestHandler; | ||
|
||
fn request_handler(options: Self::Options) -> Self::RequestHandler; | ||
} | ||
|
||
/// A `trait` that shows the implementing type is able to create [generic_api_client::websocket::WebSockethandler]s | ||
pub trait WebSocketOption<H>: HandlerOption { | ||
type WebSocketHandler; | ||
|
||
fn websocket_handler(handler: H, options: Self::Options) -> Self::WebSocketHandler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.