1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
//! # Wallabag API //! //! Provides full type-safe access to a [Wallabag](https://wallabag.org/) API server. Contains //! methods for creating, reading, modifying, and deleting entries, annotations, and tags. //! //! //! Example code to retrieve and print all starred entries. //! ``` //! use std::env; //! //! use wallabag_api::types::{Config, EntriesFilter, SortBy, SortOrder}; //! use wallabag_api::Client; //! //! pub fn main() { //! let config = Config { //! client_id: env::var("WALLABAG_CLIENT_ID").expect("WALLABAG_CLIENT_ID not set"), //! client_secret: env::var("WALLABAG_CLIENT_SECRET").expect("WALLABAG_CLIENT_SECRET not set"), //! username: env::var("WALLABAG_USERNAME").expect("WALLABAG_USERNAME not set"), //! password: env::var("WALLABAG_PASSWORD").expect("WALLABAG_PASSWORD not set"), //! base_url: env::var("WALLABAG_URL").expect("WALLABAG_URL not set"), //! }; //! //! println!("{:#?}", config); //! //! let mut client = Client::new(config); //! //! let filter = EntriesFilter { //! archive: None, //! starred: Some(true), //! sort: SortBy::Created, //! order: SortOrder::Desc, //! tags: vec![], //! since: 0, //! public: None, //! }; //! //! let response = client.get_entries_with_filter(&filter); //! match response { //! Err(e) => { //! println!("Error: {}", e); //! } //! Ok(entries) => { //! // do something with the entries! //! for entry in entries { //! println!( //! "{} | {} | Starred at {}", //! entry.id, //! entry.title.unwrap_or("Untitled".to_owned()), //! entry.starred_at.unwrap() //! ); //! } //! } //! } //! } //! ``` mod client; pub mod errors; pub mod types; mod utils; pub use crate::client::Client; pub use crate::errors::ClientError;