pub struct ArchivedHistorySegment(/* private fields */);Expand description
Archived history segment after archiving is applied.
Dereferences to a fixed-size array of pieces, such that the number of pieces can’t be changed.
Implementations§
Source§impl ArchivedHistorySegment
impl ArchivedHistorySegment
Sourcepub const NUM_PIECES: usize = RecordedHistorySegment::NUM_PIECES
pub const NUM_PIECES: usize = RecordedHistorySegment::NUM_PIECES
Number of pieces in one segment of archived history.
Sourcepub const SIZE: usize
pub const SIZE: usize
Size of archived history segment in bytes.
It includes erasure coded InnerPieces (both source and parity) that are
composed of crate::pieces::Records together with corresponding roots and
proofs.
Sourcepub fn split_records_mut(&mut self) -> ([&mut Record; 128], [&mut Record; 128])
pub fn split_records_mut(&mut self) -> ([&mut Record; 128], [&mut Record; 128])
All records of this segment, split into source and parity halves
Sourcepub fn pieces(&self) -> Box<dyn ExactSizeIterator<Item = Piece> + '_>
pub fn pieces(&self) -> Box<dyn ExactSizeIterator<Item = Piece> + '_>
Iterator over all pieces, see FlatPieces::pieces() for details
Sourcepub fn source_pieces(&self) -> impl ExactSizeIterator<Item = Piece> + '_
pub fn source_pieces(&self) -> impl ExactSizeIterator<Item = Piece> + '_
Iterator over source pieces, see FlatPieces::source_pieces() for details
Sourcepub fn parity_pieces(&self) -> impl ExactSizeIterator<Item = Piece> + '_
pub fn parity_pieces(&self) -> impl ExactSizeIterator<Item = Piece> + '_
Iterator over parity pieces, see FlatPieces::parity_pieces() for details
Ensure archived history segment contains cheaply cloneable shared data.
Internally archived history segment uses CoW mechanism and can store either mutable owned data or data that is cheap to clone, calling this method will ensure further clones and returned pieces will not result in additional memory allocations.
Trait Implementations§
Source§impl AsMut<[InnerPiece; 256]> for ArchivedHistorySegment
impl AsMut<[InnerPiece; 256]> for ArchivedHistorySegment
Source§fn as_mut(&mut self) -> &mut [InnerPiece; 256]
fn as_mut(&mut self) -> &mut [InnerPiece; 256]
Source§impl AsMut<[[InnerPiece; 128]; 2]> for ArchivedHistorySegment
impl AsMut<[[InnerPiece; 128]; 2]> for ArchivedHistorySegment
Source§impl AsRef<[InnerPiece; 256]> for ArchivedHistorySegment
impl AsRef<[InnerPiece; 256]> for ArchivedHistorySegment
Source§fn as_ref(&self) -> &[InnerPiece; 256]
fn as_ref(&self) -> &[InnerPiece; 256]
Source§impl AsRef<[[InnerPiece; 128]; 2]> for ArchivedHistorySegment
impl AsRef<[[InnerPiece; 128]; 2]> for ArchivedHistorySegment
Source§impl Clone for ArchivedHistorySegment
impl Clone for ArchivedHistorySegment
Source§fn clone(&self) -> ArchivedHistorySegment
fn clone(&self) -> ArchivedHistorySegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArchivedHistorySegment
impl Debug for ArchivedHistorySegment
Source§impl Default for ArchivedHistorySegment
impl Default for ArchivedHistorySegment
Source§impl Deref for ArchivedHistorySegment
impl Deref for ArchivedHistorySegment
Source§impl DerefMut for ArchivedHistorySegment
impl DerefMut for ArchivedHistorySegment
impl Eq for ArchivedHistorySegment
Source§impl Index<PiecePosition> for ArchivedHistorySegment
impl Index<PiecePosition> for ArchivedHistorySegment
Source§type Output = InnerPiece
type Output = InnerPiece
Source§impl PartialEq for ArchivedHistorySegment
impl PartialEq for ArchivedHistorySegment
impl StructuralPartialEq for ArchivedHistorySegment
Auto Trait Implementations§
impl !Freeze for ArchivedHistorySegment
impl RefUnwindSafe for ArchivedHistorySegment
impl Send for ArchivedHistorySegment
impl Sync for ArchivedHistorySegment
impl Unpin for ArchivedHistorySegment
impl UnsafeUnpin for ArchivedHistorySegment
impl UnwindSafe for ArchivedHistorySegment
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> 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