pub struct RecoveryReader { /* private fields */ }Expand description
Streaming RecoverySlice reader for one recovery set, accumulating rows
across volumes under a RecoveryBudget.
Rows are held in the order their packets were read. When the budget is full, a new row is kept only if its exponent is lower than the highest one held, which is then dropped. Peak memory is one slice over the budget.
Implementations§
Source§impl RecoveryReader
impl RecoveryReader
Sourcepub fn new(set_id: [u8; 16], slice_size: u64) -> Self
pub fn new(set_id: [u8; 16], slice_size: u64) -> Self
Reader for recovery set set_id with slices of slice_size bytes, an
unlimited budget and the DEFAULT_MAX_VOLUME_BYTES cap.
Sourcepub fn with_budget(self, budget: RecoveryBudget) -> Self
pub fn with_budget(self, budget: RecoveryBudget) -> Self
Set the budget (builder form of set_budget).
Sourcepub fn with_max_volume_bytes(self, max: u64) -> Self
pub fn with_max_volume_bytes(self, max: u64) -> Self
Cap the bytes read from one volume. A volume longer than this reports
VolumeEnd::CapReached.
Sourcepub fn set_budget(&mut self, budget: RecoveryBudget)
pub fn set_budget(&mut self, budget: RecoveryBudget)
Change the budget. Shrinking it drops the highest-exponent rows now.
Sourcepub fn blocks(&self) -> &[RecoveryBlock]
pub fn blocks(&self) -> &[RecoveryBlock]
Rows held, in packet order.
Sourcepub fn into_blocks(self) -> Vec<RecoveryBlock>
pub fn into_blocks(self) -> Vec<RecoveryBlock>
Take the held rows, in packet order.
Sourcepub fn read_volume<R: Read>(&mut self, reader: R) -> VolumeScan
pub fn read_volume<R: Read>(&mut self, reader: R) -> VolumeScan
Read RecoverySlice packets from one volume.
Packets for other sets, other packet types and rows outside the budget
are read past without being buffered. Never fails: how the read ended
is in VolumeScan::end, and rows found before a failure are kept.
Trait Implementations§
Source§impl Clone for RecoveryReader
impl Clone for RecoveryReader
Auto Trait Implementations§
impl Freeze for RecoveryReader
impl RefUnwindSafe for RecoveryReader
impl Send for RecoveryReader
impl Sync for RecoveryReader
impl Unpin for RecoveryReader
impl UnsafeUnpin for RecoveryReader
impl UnwindSafe for RecoveryReader
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more