pub(super) trait Shred<'a>: Sized {
    type SignedData: AsRef<[u8]>;

    const SIZE_OF_PAYLOAD: usize;
    const SIZE_OF_HEADERS: usize;

    // Required methods
    fn from_payload(shred: Vec<u8>) -> Result<Self, Error>;
    fn common_header(&self) -> &ShredCommonHeader;
    fn sanitize(&self) -> Result<(), Error>;
    fn set_signature(&mut self, signature: Signature);
    fn payload(&self) -> &Vec<u8> ;
    fn into_payload(self) -> Vec<u8> ;
    fn erasure_shard_index(&self) -> Result<usize, Error>;
    fn erasure_shard(self) -> Result<Vec<u8>, Error>;
    fn erasure_shard_as_slice(&self) -> Result<&[u8], Error>;
    fn signed_data(&'a self) -> Result<Self::SignedData, Error>;
    fn set_index(&mut self, index: u32);
    fn set_slot(&mut self, slot: Slot);
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn from_payload(shred: Vec<u8>) -> Result<Self, Error>

source

fn common_header(&self) -> &ShredCommonHeader

source

fn sanitize(&self) -> Result<(), Error>

source

fn set_signature(&mut self, signature: Signature)

source

fn payload(&self) -> &Vec<u8>

source

fn into_payload(self) -> Vec<u8>

source

fn erasure_shard_index(&self) -> Result<usize, Error>

source

fn erasure_shard(self) -> Result<Vec<u8>, Error>

source

fn erasure_shard_as_slice(&self) -> Result<&[u8], Error>

source

fn signed_data(&'a self) -> Result<Self::SignedData, Error>

source

fn set_index(&mut self, index: u32)

source

fn set_slot(&mut self, slot: Slot)

Implementors§

source§

impl<'a> Shred<'a> for solana_ledger::shred::legacy::ShredCode

§

type SignedData = &'a [u8]

source§

const SIZE_OF_PAYLOAD: usize = 1_228usize

source§

const SIZE_OF_HEADERS: usize = 89usize

source§

impl<'a> Shred<'a> for solana_ledger::shred::legacy::ShredData

§

type SignedData = &'a [u8]

source§

const SIZE_OF_PAYLOAD: usize = 1_228usize

source§

const SIZE_OF_HEADERS: usize = 88usize

source§

impl<'a> Shred<'a> for solana_ledger::shred::merkle::ShredCode

source§

impl<'a> Shred<'a> for solana_ledger::shred::merkle::ShredData