pub struct Record(/* private fields */);Expand description
Record contained within a piece.
NOTE: This is a stack-allocated data structure and can cause stack overflow!
Implementations§
Source§impl Record
impl Record
Sourcepub const NUM_CHUNKS: usize
pub const NUM_CHUNKS: usize
Number of chunks within one record.
Sourcepub const NUM_S_BUCKETS: usize
pub const NUM_S_BUCKETS: usize
Number of s-buckets contained within one sector record.
Essentially we chunk records and erasure code them.
Sourcepub const SIZE: usize
pub const SIZE: usize
Size of a segment record, it is guaranteed to be a multiple of RecordChunk::SIZE
Sourcepub fn new_zero_vec(length: usize) -> Vec<Self>
pub fn new_zero_vec(length: usize) -> Vec<Self>
Create vector filled with zeroed records without hitting stack overflow
Sourcepub fn slice_to_repr(value: &[Self]) -> &[[[u8; 32]; 32768]]
pub fn slice_to_repr(value: &[Self]) -> &[[[u8; 32]; 32768]]
Convenient conversion from slice of record to underlying representation for efficiency purposes.
Sourcepub fn slice_from_repr(value: &[[[u8; 32]; 32768]]) -> &[Self]
pub fn slice_from_repr(value: &[[[u8; 32]; 32768]]) -> &[Self]
Convenient conversion from slice of underlying representation to record for efficiency purposes.
Sourcepub fn slice_mut_to_repr(value: &mut [Self]) -> &mut [[[u8; 32]; 32768]]
pub fn slice_mut_to_repr(value: &mut [Self]) -> &mut [[[u8; 32]; 32768]]
Convenient conversion from mutable slice of record to underlying representation for efficiency purposes.
Sourcepub fn slice_mut_from_repr(value: &mut [[[u8; 32]; 32768]]) -> &mut [Self]
pub fn slice_mut_from_repr(value: &mut [[[u8; 32]; 32768]]) -> &mut [Self]
Convenient conversion from mutable slice of underlying representation to record for efficiency purposes.
Sourcepub fn source_chunks_root(&self) -> RecordChunksRoot
pub fn source_chunks_root(&self) -> RecordChunksRoot
Derive source chunks root on-demand
Trait Implementations§
Source§impl TrivialType for Record
impl TrivialType for Record
Source§const METADATA: &[u8]
const METADATA: &[u8]
IoTypeMetadataKind] for encoding details.const SIZE: u32 = _
§unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
§unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
Self::read_unaligned()], but doesn’t do any checks at all. Read more§unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
§unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
Self::from_bytes()], but doesn’t do any checks at all. Read more§unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
§unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
Self::from_bytes_mut()], but doesn’t do any checks at all. Read more§unsafe fn as_bytes_mut(&mut self) -> &mut [u8; { _ }]
unsafe fn as_bytes_mut(&mut self) -> &mut [u8; { _ }]
impl Copy for Record
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
Blanket Implementations§
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
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§impl<T> IoType for Twhere
T: TrivialType,
impl<T> IoType for Twhere
T: TrivialType,
§const METADATA: &'static [u8] = T::METADATA
const METADATA: &'static [u8] = T::METADATA
IoTypeMetadataKind for encoding details§type PointerType = T
type PointerType = T
IoType represents§unsafe fn from_ptr<'a>(
ptr: &'a NonNull<<T as IoType>::PointerType>,
size: &'a u32,
capacity: u32,
) -> impl Deref<Target = T> + 'a
unsafe fn from_ptr<'a>( ptr: &'a NonNull<<T as IoType>::PointerType>, size: &'a u32, capacity: u32, ) -> impl Deref<Target = T> + 'a
§unsafe fn from_mut_ptr<'a>(
ptr: &'a mut NonNull<<T as IoType>::PointerType>,
_size: &'a mut u32,
capacity: u32,
) -> impl DerefMut + 'a
unsafe fn from_mut_ptr<'a>( ptr: &'a mut NonNull<<T as IoType>::PointerType>, _size: &'a mut u32, capacity: u32, ) -> impl DerefMut + 'a
§unsafe fn as_ptr(
&self,
) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
unsafe fn as_ptr( &self, ) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
§unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)