Crate urlshortener

source ·
Expand description


An easy library for retrieving short urls.


Creating a short URL via a specified provider is very simple:

use urlshortener::{providers::Provider, client::UrlShortener};

let us = UrlShortener::new().unwrap();
let short_url = us.generate("", &Provider::IsGd);

Or attempting all URL shorteners until one is successfully generated:

use urlshortener::client::UrlShortener;

let us = UrlShortener::new().unwrap();
let short_url = us.try_generate("", None);

In order to use service with authentication use the appropriate provider directly:

use urlshortener::{ client::UrlShortener, providers::Provider };

let us = UrlShortener::new().unwrap();
let key = "MY_API_KEY";
let short_url = us.generate("", &Provider::GooGl { api_key:
key.to_owned() });


  • A urlshortener http client for performing requests.
  • A prelude module with main useful stuff.
  • Library service providers implementation.
  • A request builders for sending via http client.