Crate pexels_uri

Crate pexels_uri 

Source
Expand description

Create URI’s for Pexels API using.

§API Documentation

This is not an official crate from Pexels, their documentation can be found here

§Examples

use pexels_uri::{videos, Orientation};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let uri_builder = videos::Search::builder()
        .query("Dogs running")
        .orientation(Orientation::Landscape)
        .per_page(25)
        .build();

    assert_eq!(
        "https://api.pexels.com/videos/search?query=Dogs+running&per_page=25&orientation=landscape",
        uri_builder.create_uri()?
    );
    Ok(())
}

Modules§

photos
Building URI for Pexels Photos
videos
Building URI for Pexels Videos

Enums§

Locale
The locale of the search you are performing.
Orientation
Desired photo orientation.
PexelsError
Errors that can occurr while creating Pexels URI.
Size
Minimum video/photo size.