[][src]Struct grammarbot::Client

pub struct Client { /* fields omitted */ }

The primary way to interact with the API.

Methods

impl Client[src]

pub fn new(api_key: &str) -> Self[src]

Create a new Client.

Currently it requires an API key. If you need one, sign up with GrammarBot.

let api_key = "your_api_key";
let client = Client::new(api_key);

pub fn check(&self, text: &str) -> Result<Response>[src]

pub fn api_key(&mut self, api_key: &str) -> &mut Self[src]

Set the API key for the client.

let client = Client::new(api_key).api_key(other_api_key);

pub fn language(&mut self, language: &str) -> &mut Self[src]

Set the language for the client.

let client = Client::new(api_key).language("en-UK");

pub fn base(&mut self, base: &str) -> Result<&mut Self>[src]

Set the base URL for the client.

let client = Client::new(api_key).base("http://pro.grammarbot.io");

Auto Trait Implementations

impl Unpin for Client

impl Sync for Client

impl Send for Client

impl !UnwindSafe for Client

impl !RefUnwindSafe for Client

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err