pexels-uri

Crates.iopexels-uri
lib.rspexels-uri
version0.1.0
sourcesrc
created_at2023-03-18 20:49:04.174816
updated_at2023-03-18 20:49:04.174816
descriptionCreate URI's for Pexels API
homepage
repositoryhttps://github.com/emilsivervik/pexels-uri-rs
max_upload_size
id813976
size45,257
Emil Sivervik (emilsivervik)

documentation

README

pexels-uri

Create URI's for Pexels API using the builderpattern.

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(())
}

Commit count: 2

cargo fmt