You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
574 B
Rust

use crate::api::items::Items;
use crate::api::recipes::Recipes;
use crate::models::version::Version;
use std::sync::Arc;
#[cfg(test)]
mod tests;
pub mod items;
mod recipes;
pub mod versions;
pub struct Api {
pub version: Arc<Version>,
pub items: Items,
pub recipes: Recipes,
}
impl Api {
pub fn new(version: Version) -> Self {
let version = Arc::new(version);
Self {
version: Arc::clone(&version),
items: Items::new(Arc::clone(&version)),
recipes: Recipes::new(Arc::clone(&version)),
}
}
}