aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Edgecumbe <git@esotericnonsense.com>2019-10-29 01:34:55 +0100
committerDaniel Edgecumbe <git@esotericnonsense.com>2019-10-29 01:34:55 +0100
commitbafe83cb21cf89418e760b16dd83c800017fa071 (patch)
tree13d6209045eacd857d89cf116bdd51af250548f7
parent2e748f1b41f25893c0db01b5ca49d03671fff1d7 (diff)
Move more documentation to lib.rs
-rw-r--r--README.md98
-rw-r--r--src/lib.rs27
2 files changed, 33 insertions, 92 deletions
diff --git a/README.md b/README.md
index 0a8cbff..e06898b 100644
--- a/README.md
+++ b/README.md
@@ -2,101 +2,15 @@
The `botfair` crate provides Rust bindings for the Betfair SportsAPING.
-Login and keep-alive are handled automatically by the BFClient.
+Documentation for the crate may be found at [docs.rs](https://docs.rs/botfair),
+or alternatively in the file [lib.rs](src/lib.rs).
-<https://git.esotericnonsense.com/pub/botfair.git> - main repository
-
-<https://github.com/esotericnonsense/botfair.git> - github repo, for PRs etc
-
-## Warranty
-
-> This program is distributed in the hope that it will be useful,
-> but WITHOUT ANY WARRANTY; without even the implied warranty of
-> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Paid support, consulting, and contracting services are available.
+Main git repository: <https://git.esotericnonsense.com/pub/botfair.git>
+Sourcehut: <https://git.sr.ht/~esotericnonsense/botfair>
+GitLab: <https://gitlab.com/esotericnonsense/botfair.git>
+GitHub: <https://github.com/esotericnonsense/botfair.git>
## Contact
Daniel Edgecumbe (esotericnonsense)
-
[botfair@esotericnonsense.com](mailto:botfair@esotericnonsense.com)
-
-## Usage
-Note that `botfair` requires your certificate to be in `pfx` format.
-
-In order to achieve this given a key and crt file, you can use the following
-openssl command:
-
-```
-openssl pkcs12 -export -out client.pfx \
- -inkey client.key -in client.crt
-```
-
-`botfair` assumes no password protection for the `pfx` file.
-
-```
-let bf_creds = BFCredentials::new(
- "my_username".to_owned(),
- "my_password".to_owned(),
- "/path/to/pfx/file".to_owned(),
- "my_appkey".to_owned()
-).unwrap();
-
-let bf_client = BFClient::new(
- bf_creds,
- None
-).unwrap();
-
-// This is all rather verbose at the moment.
-// What will the future bring?
-let market_filter = MarketFilter {
- textQuery: None,
- exchangeIds: None,
- eventTypeIds: None,
- eventIds: None,
- competitionIds: None,
- marketIds: None,
- venues: None,
- bspOnly: None,
- turnInPlayEnabled: None,
- inPlayOnly: None,
- marketBettingTypes: None,
- marketCountries: None,
- marketTypeCodes: None,
- marketStartTime: None,
- withOrders: None,
- raceTypes: None,
-};
-
-// List ten arbitrary markets
-let catalogues: Vec<MarketCatalogue> =
- bf_client.listMarketCatalogue(market_filter, None, None, 10, None)?;
-
-println!("{:?}", catalogues);
-```
-
-## Generating the bindings
-
-If you just want to use the crate, you can skip this section as the bindings
-are already present.
-
-To re-generate the bindings from the Betfair XML documentation, you will need
-to `cd genapi; ./main.sh` which fetches the documentation from Betfair's
-servers and runs a python script on them to generate the Rust bindings.
-
-## License
-
-For open source software, `botfair` is subject to the GNU AGPLv3, contained
-in the document LICENSE.AGPLv3 which should be distributed with the software.
-
-This means that you need to licence your software under the same terms. In
-particular, this means that software that makes use of this library must
-make available its' source code to the users of said software, whether that
-software is interacted with over a network or by the end users directly.
-
-For closed source software, exceptions may be made at the discretion of the
-author.
-
-For paid support, licensing queries, or general banter, please use the below
-contact details:
diff --git a/src/lib.rs b/src/lib.rs
index a91752f..fe93e73 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,6 +34,9 @@
//!
//! Paid support, consulting, and contracting services are available.
//!
+//! For more information, contact Daniel Edgecumbe at
+//! <botfair@esotericnonsense.com>.
+//!
//! ## Example
//! Note that `botfair` requires your certificate to be in `pfx` format.
//! In order to achieve this given a key and crt file, you can use the
@@ -94,6 +97,30 @@
//! Ok(())
//! }
//! ```
+//!
+//! ## Generating the bindings
+//!
+//! If you just want to use the crate, you can skip this section as the
+//! bindings are already present.
+//!
+//! To re-generate the bindings from the Betfair XML documentation, you will
+//! need to `cd genapi; ./main.sh` which fetches the documentation from
+//! Betfair's servers and runs a python script on them to generate the Rust
+//! bindings.
+//!
+//! ## License
+//!
+//! For open source software, `botfair` is subject to the GNU AGPLv3, contained
+//! in the document LICENSE.AGPLv3 which should be distributed with the
+//! software.
+//!
+//! This means that you need to licence your software under the same terms. In
+//! particular, this means that software that makes use of this library must
+//! make available its' source code to the users of said software, whether that
+//! software is interacted with over a network or by the end users directly.
+//!
+//! For closed source software, exceptions may be made at the discretion of the
+//! author.
#[macro_use]
extern crate log;