#osrs #runescape #traits

osrs-bytes

Traits for working with bytes in Oldschool RuneScape

6 releases (breaking)

0.5.0 Jun 27, 2023
0.4.0 Jun 26, 2023
0.3.0 Mar 27, 2023
0.2.0 Mar 27, 2023
0.0.0 Dec 31, 2022

#1233 in Development tools

Download history 3/week @ 2024-07-18 176/week @ 2024-07-25 3/week @ 2024-08-01 2/week @ 2024-08-29 11/week @ 2024-09-19 7/week @ 2024-09-26

54 downloads per month
Used in rs2-cache

MIT license

41KB
336 lines

osrs-bytes

Build API Crate dependency status Discord

Traits for working with bytes in Oldschool RuneScape.

Installation

Add this crate as a dependency to your Cargo.toml file.

[dependencies]
osrs-bytes = "0.5.0"

Example

use osrs_bytes::{ReadExt, WriteExt};
use std::io::{self, Cursor};

fn main() -> Result<(), io::Error> {
    // Read data from the cursor
    let mut csr = Cursor::new(vec![123]);
    assert_eq!(csr.read_i8()?, 123);

    // Write data to the vector
    let mut vec = Vec::new();
    vec.write_i8(124)?;
    assert_eq!(vec[0], 124);

    Ok(())
}

License

This project is licensed under the MIT license.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in osrs-bytes by you, shall be licensed as MIT, without any additional terms or conditions.

No runtime deps