brk: first commit

This commit is contained in:
nym21
2025-02-23 01:25:15 +01:00
parent 8c3f519016
commit 19cf34f9d4
266 changed files with 225 additions and 1268 deletions

21
_src/structs/date_data.rs Normal file
View File

@@ -0,0 +1,21 @@
use allocative::Allocative;
use bincode::{Decode, Encode};
use serde::{Deserialize, Serialize};
use super::{BlockData, BlockPath, Date};
#[derive(Debug, Serialize, Deserialize, Encode, Decode, Allocative)]
pub struct DateData {
pub date: Date,
pub blocks: Vec<BlockData>,
}
impl DateData {
pub fn new(date: Date, blocks: Vec<BlockData>) -> Self {
Self { date, blocks }
}
pub fn get_block_data(&self, block_path: &BlockPath) -> Option<&BlockData> {
self.blocks.get(block_path.block_index as usize)
}
}