pub struct Media { /* private fields */ }Expand description
Retrieve a specific media item by its ID.
This endpoint returns all media items (photos and videos) within a single collection.
Use the type parameter to filter results to only photos or only videos.
Implementations§
Source§impl Media
impl Media
Sourcepub fn builder() -> MediaBuilder
pub fn builder() -> MediaBuilder
Creates MediaBuilder for building URI’s.
Sourcepub fn create_uri(&self) -> Result<String, PexelsError>
pub fn create_uri(&self) -> Result<String, PexelsError>
Create URI from inputted vales from the MediaBuilder.
Sourcepub async fn fetch(&self, client: &Pexels) -> Result<MediaResponse, PexelsError>
pub async fn fetch(&self, client: &Pexels) -> Result<MediaResponse, PexelsError>
Fetch the photo or video data from the Pexels API.
Auto Trait Implementations§
impl Freeze for Media
impl RefUnwindSafe for Media
impl Send for Media
impl Sync for Media
impl Unpin for Media
impl UnwindSafe for Media
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