pub struct SkyblockRepo {
pub enchantments: FxHashMap<String, SkyblockEnchantment>,
pub items: FxHashMap<String, SkyblockItem>,
pub npcs: FxHashMap<String, SkyblockNpc>,
pub pets: FxHashMap<String, SkyblockPet>,
pub shops: FxHashMap<String, SkyblockShop>,
pub zones: FxHashMap<String, SkyblockZone>,
}Expand description
each category of items as a mapping of internal_id to its item data
Fields§
§enchantments: FxHashMap<String, SkyblockEnchantment>§items: FxHashMap<String, SkyblockItem>§npcs: FxHashMap<String, SkyblockNpc>§pets: FxHashMap<String, SkyblockPet>§shops: FxHashMap<String, SkyblockShop>§zones: FxHashMap<String, SkyblockZone>Implementations§
Source§impl SkyblockRepo
impl SkyblockRepo
Sourcepub fn new() -> Result<Self, Box<dyn Error>>
pub fn new() -> Result<Self, Box<dyn Error>>
Examples found in repository?
examples/basic.rs (line 14)
5fn main() {
6 let mut start = Instant::now();
7 download_repo(false, None).unwrap();
8 println!(
9 "Time taken to download and extract repo: {}s",
10 start.elapsed().as_secs_f32()
11 );
12 start = Instant::now();
13
14 let data = SkyblockRepo::new().unwrap();
15 println!(
16 "Time taken to parse repo: {}ms",
17 start.elapsed().as_millis()
18 );
19 start = Instant::now();
20
21 println!("{:?}", data.get_enchantment_by_id("TELEKINESIS"));
22 println!(
23 "Time taken to get data for `TELEKINESIS`: {}µs",
24 (start.elapsed().as_nanos() as f32 / 1_000.0)
25 );
26 start = Instant::now();
27
28 delete_repo().unwrap();
29 println!(
30 "Time taken to delete repo: {}ms",
31 start.elapsed().as_millis()
32 );
33}Sourcepub fn get_enchantment_by_id(&self, id: &str) -> Option<SkyblockEnchantment>
pub fn get_enchantment_by_id(&self, id: &str) -> Option<SkyblockEnchantment>
Retrieves a $name by its internalId.
Examples found in repository?
examples/basic.rs (line 21)
5fn main() {
6 let mut start = Instant::now();
7 download_repo(false, None).unwrap();
8 println!(
9 "Time taken to download and extract repo: {}s",
10 start.elapsed().as_secs_f32()
11 );
12 start = Instant::now();
13
14 let data = SkyblockRepo::new().unwrap();
15 println!(
16 "Time taken to parse repo: {}ms",
17 start.elapsed().as_millis()
18 );
19 start = Instant::now();
20
21 println!("{:?}", data.get_enchantment_by_id("TELEKINESIS"));
22 println!(
23 "Time taken to get data for `TELEKINESIS`: {}µs",
24 (start.elapsed().as_nanos() as f32 / 1_000.0)
25 );
26 start = Instant::now();
27
28 delete_repo().unwrap();
29 println!(
30 "Time taken to delete repo: {}ms",
31 start.elapsed().as_millis()
32 );
33}Sourcepub fn get_item_by_id(&self, id: &str) -> Option<SkyblockItem>
pub fn get_item_by_id(&self, id: &str) -> Option<SkyblockItem>
Retrieves a $name by its internalId.
Sourcepub fn get_pet_by_id(&self, id: &str) -> Option<SkyblockPet>
pub fn get_pet_by_id(&self, id: &str) -> Option<SkyblockPet>
Retrieves a $name by its internalId.
Sourcepub fn get_npc_by_id(&self, id: &str) -> Option<SkyblockNpc>
pub fn get_npc_by_id(&self, id: &str) -> Option<SkyblockNpc>
Retrieves a $name by its internalId.
Sourcepub fn get_shop_by_id(&self, id: &str) -> Option<SkyblockShop>
pub fn get_shop_by_id(&self, id: &str) -> Option<SkyblockShop>
Retrieves a $name by its internalId.
Sourcepub fn get_zone_by_id(&self, id: &str) -> Option<SkyblockZone>
pub fn get_zone_by_id(&self, id: &str) -> Option<SkyblockZone>
Retrieves a $name by its internalId.
Auto Trait Implementations§
impl Freeze for SkyblockRepo
impl RefUnwindSafe for SkyblockRepo
impl Send for SkyblockRepo
impl Sync for SkyblockRepo
impl Unpin for SkyblockRepo
impl UnwindSafe for SkyblockRepo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more