pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
impl Reconstructor
sourcepub fn reconstruct_segment(
&self,
segment_pieces: &[Option<Piece>],
) -> Result<Segment, ReconstructorError>
pub fn reconstruct_segment( &self, segment_pieces: &[Option<Piece>], ) -> Result<Segment, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are required to be present, the rest will be recovered automatically due to use of erasure coding if needed), reconstructs and returns the segment itself.
Does not modify the internal state of the reconstructor.
sourcepub fn add_segment(
&mut self,
segment_pieces: &[Option<Piece>],
) -> Result<ReconstructedContents, ReconstructorError>
pub fn add_segment( &mut self, segment_pieces: &[Option<Piece>], ) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are required to be present, the rest will be recovered automatically due to use of erasure coding if needed), reconstructs and returns segment header and a list of encoded blocks with corresponding block numbers.
It is possible to start with any segment, but when next segment is pushed, it needs to follow the previous one or else error will be returned.
Trait Implementations§
source§impl Clone for Reconstructor
impl Clone for Reconstructor
source§fn clone(&self) -> Reconstructor
fn clone(&self) -> Reconstructor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for Reconstructor
impl RefUnwindSafe for Reconstructor
impl Send for Reconstructor
impl Sync for Reconstructor
impl Unpin for Reconstructor
impl UnwindSafe for Reconstructor
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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