Struct celestia_types::sample::SampleId
source · pub struct SampleId { /* private fields */ }Expand description
Identifies a particular Share located in the ExtendedDataSquare.
Implementations§
source§impl SampleId
impl SampleId
sourcepub fn new(row_index: u16, column_index: u16, block_height: u64) -> Result<Self>
pub fn new(row_index: u16, column_index: u16, block_height: u64) -> Result<Self>
Create a new SampleId for the given row_index and column_index of the
ExtendedDataSquare in a block.
§Errors
This function will return an error if the block height is zero.
§Example
use celestia_types::sample::SampleId;
// Consider an 64 share EDS with block height of 15
let header_height = 15;
SampleId::new(2, 1, header_height).unwrap();sourcepub fn block_height(&self) -> u64
pub fn block_height(&self) -> u64
A height of the block which contains the sample.
sourcepub fn row_index(&self) -> u16
pub fn row_index(&self) -> u16
Row index of the ExtendedDataSquare that sample is located on.
sourcepub fn column_index(&self) -> u16
pub fn column_index(&self) -> u16
Column index of the ExtendedDataSquare that sample is located on.
Trait Implementations§
source§impl From<SampleId> for CidGeneric<SAMPLE_ID_SIZE>
impl From<SampleId> for CidGeneric<SAMPLE_ID_SIZE>
impl Copy for SampleId
impl StructuralPartialEq for SampleId
Auto Trait Implementations§
impl Freeze for SampleId
impl RefUnwindSafe for SampleId
impl Send for SampleId
impl Sync for SampleId
impl Unpin for SampleId
impl UnwindSafe for SampleId
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)