nbp 0.2.0

A Rust library for accessing the National Bank of Poland's API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use chrono::NaiveDate;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GoldPrice {
    #[serde(rename = "data")]
    pub date: NaiveDate,
    #[serde(rename = "cena")]
    pub price: f64,
}

impl GoldPrice {
    pub fn new(date: NaiveDate, price: f64) -> Self {
        Self { date, price }
    }
}