update example

This commit is contained in:
Quaternions 2024-12-31 18:42:02 -08:00
parent 5177061ae5
commit 942e5ee1d8

View File

@ -9,6 +9,11 @@ use strafesnet_roblox_bot_file::{File,TimedBlockId};
let file=std::fs::File::open("bot_file")?;
let input=std::io::BufReader::new(file);
let mut bot_file=File::new(input)?;
// read the whole file
let block=bot_file.read_all()?;
// or do data streaming block by block
for &TimedBlockId{time,block_id} in &bot_file.header.offline_blocks_timeline{
// header is immutably borrowed
// while data is mutably borrowed