Skip to content

Commit 87dbbd1

Browse files
committed
fix: add new function
1 parent 67f3e28 commit 87dbbd1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/chunk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ impl<R: MappedRecord> Chunk<R> {
4848
// think about how best to implement this, and where to store the tags
4949
// (a) should the tags be part of the record, or stored externally (e.g. in a parallel
5050
// Vec)?
51-
// (b) should the tags be read into an "unparsed" structure (e.g. a binary blob) and
51+
// (b) should the tags be read into an "unparsed" structure (e.g. a binary blob) and
5252
// then parsed on demand, or parsed as they are read here?
5353
// (c) What's the best mechanism to allow the user to access the tags?
5454
todo!("Should read and store the optional tags associated with each record.");
5555
}
56-
56+
5757
/// Read the next [Chunk] from the provided reader and return it.
5858
#[inline]
5959
pub fn from_bytes<T: Read>(reader: &mut T, ctx: &R::ParsingContext) -> Self {

src/header.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ impl RadHeader {
137137
}
138138

139139
impl RadPrelude {
140+
pub fn from_header_and_sections(
141+
hdr: RadHeader,
142+
file_tags: TagSection,
143+
read_tags: TagSection,
144+
aln_tags: TagSection,
145+
) -> Self {
146+
Self {
147+
hdr,
148+
file_tags,
149+
read_tags,
150+
aln_tags,
151+
}
152+
}
153+
140154
/// Read a [RadPrelude] from the provided `reader`, which includes the
141155
/// [RadHeader] as well as the relevant [TagSection]s. This function returns
142156
/// an `std::Ok(`[RadPrelude]`)` if the prelude is parsed succesfully and an

0 commit comments

Comments
 (0)