[−][src]Struct grammarbot::Client
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 Sync for Client
impl Send for Client
impl Unpin for Client
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,