pub struct Upload { /* private fields */ }Implementations§
Source§impl Upload
impl Upload
pub fn new(api_key: String, cloud_name: String, api_secret: String) -> Self
Sourcepub async fn image(
&self,
src: Source,
options: &BTreeSet<OptionalParameters>,
) -> Result<UploadResult>
pub async fn image( &self, src: Source, options: &BTreeSet<OptionalParameters>, ) -> Result<UploadResult>
Uploads an image
use std::collections::BTreeSet;
use cloudinary::upload::{Source, Upload, OptionalParameters};
let upload = Upload::new("api_key".to_string(), "cloud_name".to_string(), "api_secret".to_string() );
let options = BTreeSet::from([OptionalParameters::PublicId("file.jpg".to_string())]);
let result = upload.image(Source::Path("./image.jpg".into()), &options);Sourcepub async fn destroy<IS>(&self, public_id: IS) -> Result<DestroyResult>
pub async fn destroy<IS>(&self, public_id: IS) -> Result<DestroyResult>
destroy the asset by public id.
use cloudinary::upload::{Source, Upload};
let upload = Upload::new("api_key".to_string(), "cloud_name".to_string(), "api_secret".to_string() );
let result = upload.destroy("image");Auto Trait Implementations§
impl Freeze for Upload
impl RefUnwindSafe for Upload
impl Send for Upload
impl Sync for Upload
impl Unpin for Upload
impl UnsafeUnpin for Upload
impl UnwindSafe for Upload
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