pub(crate) struct PartCache<'a> {
pub(crate) parts: &'a [PartInfo],
pub(crate) loaded: HashMap<usize, Archive>,
}Expand description
Loads part files on demand and drops them once no later window needs them.
Fields§
§parts: &'a [PartInfo]First-pass information for every non-empty part file.
loaded: HashMap<usize, Archive>Loaded contents, by index into parts.
Implementations§
Source§impl<'a> PartCache<'a>
impl<'a> PartCache<'a>
Sourcepub(crate) fn window_rows(
&mut self,
window: i64,
rotate_secs: u64,
) -> Result<Vec<(usize, Vec<(usize, i64, u64)>)>>
pub(crate) fn window_rows( &mut self, window: i64, rotate_secs: u64, ) -> Result<Vec<(usize, Vec<(usize, i64, u64)>)>>
Returns every row of every part file in window, tagged with its group.
Files are loaded the first time a window needs them and dropped once their last window has been served, so memory holds only the files around the current window.
§Arguments
window- Window to collect. Windows must be requested in increasing order.rotate_secs- Window length in seconds.
§Returns
The rows (unsorted, duplicates included) and, per source file, the rows that file contributed, for the independent check.
§Errors
Returns an error if a file cannot be read.
Auto Trait Implementations§
impl<'a> Freeze for PartCache<'a>
impl<'a> RefUnwindSafe for PartCache<'a>
impl<'a> Send for PartCache<'a>
impl<'a> Sync for PartCache<'a>
impl<'a> Unpin for PartCache<'a>
impl<'a> UnsafeUnpin for PartCache<'a>
impl<'a> UnwindSafe for PartCache<'a>
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more