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::sync::Tinify;
use tinify::error::TinifyError;
fn main() -> Result<(), TinifyError> {
let key = "tinify api key";
let tinify = Tinify::new().set_key(key);
let client = tinify.get_client()?;
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tinify
impl RefUnwindSafe for Tinify
impl Send for Tinify
impl Sync for Tinify
impl Unpin for Tinify
impl UnwindSafe for Tinify
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more