diff options
author | Daniel Edgecumbe <git@esotericnonsense.com> | 2019-10-27 03:28:55 +0100 |
---|---|---|
committer | Daniel Edgecumbe <git@esotericnonsense.com> | 2019-10-27 03:28:55 +0100 |
commit | b4d0a5ddc02eeb44a38ff342d1799f56a4fe739a (patch) | |
tree | 0ebdb0e316c7df77b6fee7453cc2065eb00c7e87 | |
parent | e2f3538226095e2b01df7d2bf941530784d7b89b (diff) |
Add documentation to root lib.rs, re-export BFClient and BFCredentials
-rw-r--r-- | src/lib.rs | 57 |
1 files changed, 57 insertions, 0 deletions
@@ -14,6 +14,60 @@ // You should have received a copy of the GNU Affero General Public License // along with botfair. If not, see <http://www.gnu.org/licenses/>. +//! # botfair +//! +//! The `botfair` crate provides Rust bindings for the Betfair SportsAPING. +//! +//! ## Example +//! ``` +//! use botfair::generated_types::{MarketBook, MarketCatalogue}; +//! use botfair::generated_types::{MarketFilter, MarketId}; +//! use botfair::result::Result; +//! use botfair::{BFClient, BFCredentials}; +//! +//! fn main() -> Result<()> { +//! 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); +//! Ok(()) +//! } +//! ``` + #[macro_use] extern crate log; @@ -28,3 +82,6 @@ pub mod prelude { pub use crate::client::BFClient; pub use crate::client::BFCredentials; } + +pub use crate::client::BFClient; +pub use crate::client::BFCredentials; |