Skip to content

A crate for fetching currency values from dolarhoy.com.

License

Notifications You must be signed in to change notification settings

emaphp/dolarhoy-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A crate for fetching currency values from dolarhoy.com.

dolarhoy-core on Crates.io Documentation License: MIT

Table of Contents

Basic Usage

use dolarhoy_core::{client, dolar, error};

type Result<T> = std::result::Result<T, error::ClientError>;

#[tokio::main]
async fn main() -> Result<()> {
    let client = client::DolayHoyClient::new();
    let result = client.fetch_cotizacion::<f32>(dolar::Cotizacion::Blue).await?;

    match result.precio_compra_venta() {
        (compra, None) => println!("{}: {}", result.title(), compra),
        (compra, Some(venta)) => println!("{}: {} / {}", result.title(), compra, venta),
    }

    Ok(())
}

License

Released under the MIT License.

Disclaimer

DolarHoy.com ® is a registered trademark. I don't hold any type of relation to the company or its staff.

About

A crate for fetching currency values from dolarhoy.com.

Resources

License

Stars

Watchers

Forks

Languages