pub struct Tinify {
pub key: String,
}Expand description
Use the API to create a new client.
Fields§
§key: StringImplementations§
source§impl Tinify
impl Tinify
sourcepub fn get_client(&self) -> Result<Client, TinifyError>
pub fn get_client(&self) -> Result<Client, TinifyError>
Get a new Tinify Client.
Examples
use tinify::Tinify;
use tinify::TinifyError;
fn main() -> Result<(), TinifyError> {
let key = "tinify api key";
let tinify = Tinify::new().set_key(key);
let client = tinify.get_client()?;
Ok(())
}