//! Utilities for [RuneScape] cache interaction.
//!
//! # Features
//!
//! The following features are currently provided:
//! - Reading from the cache.
//! - Huffman buffer access.
//! - Checksum with simple-to-use validation.
//! - Compression and decompression:
//! - [Gzip]
//! - [Bzip2]
//!
//! # Quick Start
//!
//! A possible use case of this utility is to read data from the RuneScape cache and send them to the
//! client during the update protocol.
//! The example listed below quickly shows how you can pass the `index_id` and the `archive_id` to the cache
//! and get the correct data to send to the client.
//!
//! ```
//! # use std::net::TcpStream;
//! # use std::io::Write;
//! use rscache::{ Cache, CacheError, LinkedListExt };
//! # struct UpdatePacket {
//! # pub index_id: u8,
//! # pub archive_id: u16
//! # }
//!
//! fn process_update(packet: UpdatePacket, stream: &mut TcpStream) -> Result<(), CacheError> {
//! # let cache = Cache::new("path/to/cache")?;
//! // read the specified archive from the given index to an owned vector.
//! let buffer = cache.read(packet.index_id, packet.archive_id)?.to_vec();
//!
//! // ... format buffer.
//! # let formatted_buffer = buffer;
//!
//! // send formatted_buffer to client.
//! stream.write_all(&formatted_buffer)?;
//!
//! Ok(())
//! }
//! ```
//!
//! In the above example the data that was read from the cache is transformed into a vector of bytes.
//! You can also use the `LinkedList<&[u8]>` to `iter()` over the `data_block`s instead of making the bytes owned.
//!
//! ```
//! # use std::net::TcpStream;
//! # use std::io::Write;
//! # use rscache::{ Cache, CacheError, LinkedListExt };
//! # struct UpdatePacket {
//! # pub index_id: u8,
//! # pub archive_id: u16
//! # }
//! # fn process_update(packet: UpdatePacket, stream: &mut TcpStream) -> Result<(), CacheError> {
//! # let cache = Cache::new("path/to/cache")?;
//! # // read the specified archive from the given index to an owned vector.
//! let buffer = cache.read(packet.index_id, packet.archive_id)?;
//!
//! for data_block in buffer.iter() {
//! // data_block contains 512 byte slices that directly link into the MainData buffer.
//! // this can be useful when creating a new formatted buffer.
//! }
//! # Ok(())
//! # }
//! ```
//!
//! [RuneScape]: https://oldschool.runescape.com/
//! [Gzip]: https://crates.io/crates/libflate
//! [Bzip2]: https://crates.io/crates/bzip2
pub use Cache;
pub use Checksum;
pub use *;
pub use *;