From 942e5ee1d8ed7db08c3a7d63ca05d447355a50f9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 31 Dec 2024 18:42:02 -0800 Subject: [PATCH] update example --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 918eba2..ebdf7a7 100644 --- a/README.md +++ b/README.md @@ -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