mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 15:19:58 -07:00
git: reset
This commit is contained in:
20
parser/src/structs/date_data.rs
Normal file
20
parser/src/structs/date_data.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use allocative::Allocative;
|
||||
use bincode::{Decode, Encode};
|
||||
|
||||
use super::{BlockData, BlockPath, WNaiveDate};
|
||||
|
||||
#[derive(Debug, Encode, Decode, Allocative)]
|
||||
pub struct DateData {
|
||||
pub date: WNaiveDate,
|
||||
pub blocks: Vec<BlockData>,
|
||||
}
|
||||
|
||||
impl DateData {
|
||||
pub fn new(date: WNaiveDate, 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user