pub struct Client { /* private fields */ }

Implementations

Create and authenticate a new Readwise client from a specified access token

use readwise::client::Client;

let client = Client::new("token").unwrap();

Fetch all books from a specified page

use readwise::client::Client;

let client = Client::new("token").unwrap();
let books = client.books(1).unwrap();

Fetch all highlights from a specified page

use readwise::client::Client;

let client = Client::new("token").unwrap();
let highlights = client.highlights(1).unwrap();

Fetch a single book by identifier

use readwise::client::Client;

let client = Client::new("token").unwrap();
let book = client.book(1).unwrap();

Fetch a single highlight by identifier

use readwise::client::Client;

let client = Client::new("token").unwrap();
let highlight = client.highlight(1).unwrap();

Create and return one or more highlights

use {
  std::collections::HashMap,
  readwise::client::Client
};

let client = Client::new("token").unwrap();

let mut new_highlight = HashMap::new();

new_highlight.insert("text", "hello world!");

for highlight in client.create_highlights(vec![new_highlight]).unwrap() {
  println!("{}", highlight.text);
}

Update a single highlight by identifier

use {
  std::collections::HashMap,
  readwise::client::Client
};

let client = Client::new("token").unwrap();

let mut fields = HashMap::new();
fields.insert("text", "hello, world!");

client.update_highlight(1, fields).unwrap();

Delete a single highlight by identifier

use readwise::client::Client;

let client = Client::new("token").unwrap();
client.delete_highlight(1).unwrap();

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more