Enum solana_ledger::shred::Shred
source · pub enum Shred {
ShredCode(ShredCode),
ShredData(ShredData),
}
Variants§
Implementations§
source§impl Shred
impl Shred
fn common_header(&self) -> &ShredCommonHeader
fn set_signature(&mut self, signature: Signature)
fn signed_data(&self) -> Result<SignedData<'_>, Error>
pub(crate) fn erasure_shard(self) -> Result<Vec<u8>, Error>
pub(crate) fn erasure_shard_as_slice(&self) -> Result<&[u8], Error>
pub(crate) fn erasure_shard_index(&self) -> Result<usize, Error>
pub fn into_payload(self) -> Vec<u8> ⓘ
pub fn payload(&self) -> &Vec<u8> ⓘ
pub fn sanitize(&self) -> Result<(), Error>
pub fn set_index(&mut self, index: u32)
pub fn set_slot(&mut self, slot: Slot)
pub fn copy_to_packet(&self, packet: &mut Packet)
pub fn new_from_data( slot: Slot, index: u32, parent_offset: u16, data: &[u8], flags: ShredFlags, reference_tick: u8, version: u16, fec_set_index: u32 ) -> Self
pub fn new_from_serialized_shred(shred: Vec<u8>) -> Result<Self, Error>
pub fn new_from_parity_shard( slot: Slot, index: u32, parity_shard: &[u8], fec_set_index: u32, num_data_shreds: u16, num_coding_shreds: u16, position: u16, version: u16 ) -> Self
pub fn slot(&self) -> Slot
pub fn parent(&self) -> Result<Slot, Error>
pub fn index(&self) -> u32
pub(crate) fn data(&self) -> Result<&[u8], Error>
pub(crate) fn bytes_to_store(&self) -> &[u8] ⓘ
pub fn fec_set_index(&self) -> u32
pub(crate) fn first_coding_index(&self) -> Option<u32>
pub fn version(&self) -> u16
pub(crate) fn erasure_set(&self) -> ErasureSetId
pub fn signature(&self) -> &Signature
pub fn sign(&mut self, keypair: &Keypair)
pub fn shred_type(&self) -> ShredType
pub fn is_data(&self) -> bool
pub fn is_code(&self) -> bool
pub fn last_in_slot(&self) -> bool
sourcepub fn set_last_in_slot(&mut self)
pub fn set_last_in_slot(&mut self)
This is not a safe function. It only changes the meta information. Use this only for test code which doesn’t care about actual shred
pub fn data_complete(&self) -> bool
pub(crate) fn reference_tick(&self) -> u8
pub fn verify(&self, pubkey: &Pubkey) -> bool
pub(crate) fn erasure_mismatch(&self, other: &Self) -> Result<bool, Error>
pub(crate) fn num_data_shreds(&self) -> Result<u16, Error>
pub(crate) fn num_coding_shreds(&self) -> Result<u16, Error>
Trait Implementations§
source§impl PartialEq<Shred> for Shred
impl PartialEq<Shred> for Shred
impl Eq for Shred
impl StructuralEq for Shred
impl StructuralPartialEq for Shred
Auto Trait Implementations§
impl RefUnwindSafe for Shred
impl Send for Shred
impl Sync for Shred
impl Unpin for Shred
impl UnwindSafe for Shred
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request