pub struct Media { /* private fields */ }
Expand description
Represents a request to fetch a specific media item by its ID from the Pexels API.
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 a new MediaBuilder
for constructing a Media
request.
Sourcepub fn create_uri(&self) -> Result<String, PexelsError>
pub fn create_uri(&self) -> Result<String, PexelsError>
Constructs the URI for the media request based on the builder’s parameters.
Sourcepub async fn fetch(&self, client: &Pexels) -> Result<MediaResponse, PexelsError>
pub async fn fetch(&self, client: &Pexels) -> Result<MediaResponse, PexelsError>
Fetches the media 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