IDX is a Rust crate for working with RuneScape .idx-format caches.

Related tags

Utilities idx
Overview

Crates.io Documentation Discord Chat

idx-github This image proudly made in GIMP

License

Licensed under GNU GPL, Version 3.0, (LICENSE-GPL3 or https://choosealicense.com/licenses/gpl-3.0/)

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GPL-3.0 license, will be incorporated into the project under the full terms of the GPL-3.0 license.

Where can I get a cache?

I can not, will not, and don't want to provide a copy of any cache owned by Jagex. These are copyrighted assets and I do not encourage the violation of their copyright. These are up to you to source. A good resource is the OpenRS2 Archive.

Quick Start

IDX is actually relatively straightforward to use. If you just want to get a working example spun up as quick as possible, below is an example configuration that should get you going in no time.

Note that test_cache in the below example should be replaced with the path to your IDX-formatted cache.

use std::sync::{Arc, Mutex};

use idx::*;
use idx::util::*;
use databuffer::DataBuffer;

fn main() {
    let cache = Arc::from(Mutex::from(Cache::from_path("test_cache")));

    let data_provider = FileProvider::from(&cache);
    data_provider.index(19).archive(&1);

    let mut data: DataBuffer = data_provider.request(&0); //This will return a DataBuffer containing the data from File 0, Archive 1, Index 19.
}

IDX's Cache struct is designed to be wrapped in an Arc<Mutex<Cache>> so that multiple references to it can be created at once. Both the FileProvider and DefProvider leverage this to allow creation of multiple simultaneous file/definition providers.

For more information on FileProvider and DefProvider check the documentation on docs.rs, specifically: FileProvider and DefProvider.

Benchmarks

IDX is very fast for what it has to do. Some of the speed obviously depends on whether you are using an SSD or HDD, but generally speaking, the speeds are substantial. Due to benchmarking thanks to Criterion, I am able to provide the below graphs benchmarking reading random files from Index 19.

image

You might also like...
Small utility to display hour in a binary format on the Novation's Launchpad X.
Small utility to display hour in a binary format on the Novation's Launchpad X.

lpx-binary-clock Small utility to display hour in a binary format on the Novation's Launchpad X. Hours, minutes and seconds are displayed one digit pe

A decoder and utility for the Flipnote Studios .ppm animation format
A decoder and utility for the Flipnote Studios .ppm animation format

A decoder and utility for the Flipnote Studios .ppm animation format

Rust crate which provides direct access to files within a Debian archive

debarchive This Rust crate provides direct access to files within a Debian archive. This crate is used by our debrep utility to generate the Packages

Granular locking crate for Rust

Granular locking crate for Rust. Instead of using coarse-grained Mutex or RwLock which can be used to lock an entire structure, glock provides more granular locking.

A crate to implement leader election for Kubernetes workloads in Rust.

Kubernetes Leader Election in Rust This library provides simple leader election for Kubernetes workloads.

Tiny Rust crate to iterate bit combinations

bit_combi_iter bit_combi_iter is a small dependency-free crate to enumerate all bit combinations less than given unsigned integer value keeping 1s in

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Rust crate for reading SER files used in astrophotography

Rust crate for reading SER files used in astrophotography.

A Rust crate for handling URNs.

URN A Rust crate for handling URNs. Parsing and comparison is done according to the spec (meaning only part of the URN is used for equality checks). S

Comments
  • Benchmarking and minor doc changes

    Benchmarking and minor doc changes

    Hi, creator of rs-cache here o/

    I recently stumbled upon your cache library and wanted to try and benchmark it against mine. What cache version are you using?

    On another note; some minor things I noticed in your documentation:

    • The reference linking to your databuffer crate is misspelled https://github.com/Ceikry/idx/blob/ebc40524284ee86064fbe598c7d30de2b4ac15c6/src/lib.rs#L15
    • I think you meant created instead of creating?https://github.com/Ceikry/idx/blob/ebc40524284ee86064fbe598c7d30de2b4ac15c6/src/lib.rs#L96

    I really like the lazy data loading on reads. Awesome crate overall, keep it up! :)

    opened by jimvdl 5
Owner
Ceikry
What's to say other than I like writing code
Ceikry
This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to the arrow format.

Arrow2-derive - derive for Arrow2 This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to th

Jorge Leitao 29 Dec 27, 2022
A working example of multi targets compilation for Rust using Github Actions.

A working example of multi targets compilation for Rust using Github Actions. Supports Windows, MacOSX, x86_64, ARM and Raspberry PI Linux.

Nicolas Vanhoren 41 Dec 17, 2022
Rust libraries for working with GPT (GUID Partition Table) disk data

gpt-disk-rs no_std libraries related to GPT (GUID Partition Table) disk data. There are three Rust packages in this repository: uguid The uguid packag

Google 25 Dec 24, 2022
A Rust utility library, making easier by taking the hassle out of working. :octocat:

reddish A Rust utility library, making easier by taking the hassle out of working. Usage Add this to your Cargo.toml: [dependencies] reddish = "0.2.0"

Rogério Araújo 12 Jan 21, 2023
Toolkit for working with scripts used by REDengine in Cyberpunk 2077.

redscript Toolkit for working with scripts used by REDengine in Cyberpunk 2077. Currently includes a compiler, a decompiler and a disassembler. usage

jac3km4 268 Jan 6, 2023
Estimate the amount of time spent working on a Git repository

jikyuu (時給) A tool to estimate the amount of time spent working on a Git repository. It is a direct port of git-hours, written in Node.js, because the

null 18 Nov 16, 2022
Cargo wrapper for working with Webassembly wasi(x).

cargo-wasix A cargo subcommand that wraps regular cargo commands for compiling Rust code to wasix, a superset of Websassembly wasi with additional fun

WASIX 19 Jun 12, 2023
transmute-free Rust library to work with the Arrow format

Arrow2: Transmute-free Arrow This repository contains a Rust library to work with the Arrow format. It is a re-write of the official Arrow crate using

Jorge Leitao 708 Dec 30, 2022
Serializer and deserializer for the VCR Cassette format

vcr-cassette Serializer and deserializer for the VCR Cassette format API Docs | Releases | Contributing Examples Given the following .json VCR Cassett

http-rs 12 Sep 15, 2021
Parses .off (Object File Format) files. This implementation follows this spec from the Princeton Shape Benchmark.

off-rs - A simple .off file parser Parses .off (Object File Format) files. This implementation follows this spec from the Princeton Shape Benchmark. S

Michael Lohr 2 Jun 12, 2022