Crates.io | osrs-bytes |
lib.rs | osrs-bytes |
version | 0.5.0 |
source | src |
created_at | 2022-12-31 10:47:56.795349 |
updated_at | 2023-06-27 10:46:45.246516 |
description | Traits for working with bytes in Oldschool RuneScape |
homepage | |
repository | https://github.com/osrs-rs/osrs-bytes |
max_upload_size | |
id | 748376 |
size | 43,481 |
Traits for working with bytes in Oldschool RuneScape.
Add this crate as a dependency to your Cargo.toml
file.
[dependencies]
osrs-bytes = "0.5.0"
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(())
}
This project is licensed under the MIT license.
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.