[][src]Struct solana_ledger::shred::Shred

pub struct Shred {
    pub common_header: ShredCommonHeader,
    pub data_header: DataShredHeader,
    pub coding_header: CodingShredHeader,
    pub payload: Vec<u8>,
}

Fields

common_header: ShredCommonHeaderdata_header: DataShredHeadercoding_header: CodingShredHeaderpayload: Vec<u8>

Implementations

impl Shred[src]

pub fn copy_to_packet(&self, packet: &mut Packet)[src]

pub fn new_from_data(
    slot: Slot,
    index: u32,
    parent_offset: u16,
    data: Option<&[u8]>,
    is_last_in_fec_set: bool,
    is_last_in_slot: bool,
    reference_tick: u8,
    version: u16,
    fec_set_index: u32
) -> Self
[src]

pub fn new_from_serialized_shred(payload: Vec<u8>) -> Result<Self>[src]

pub fn new_empty_from_header(
    common_header: ShredCommonHeader,
    data_header: DataShredHeader,
    coding_header: CodingShredHeader
) -> Self
[src]

pub fn new_empty_data_shred() -> Self[src]

pub fn slot(&self) -> Slot[src]

pub fn parent(&self) -> Slot[src]

pub fn index(&self) -> u32[src]

pub fn version(&self) -> u16[src]

pub fn set_index(&mut self, index: u32)[src]

pub fn set_slot(&mut self, slot: Slot)[src]

pub fn signature(&self) -> Signature[src]

pub fn seed(&self) -> [u8; 32][src]

pub fn is_data(&self) -> bool[src]

pub fn is_code(&self) -> bool[src]

pub fn last_in_slot(&self) -> bool[src]

pub fn set_last_in_slot(&mut self)[src]

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[src]

pub fn reference_tick(&self) -> u8[src]

pub fn reference_tick_from_data(data: &[u8]) -> u8[src]

pub fn verify(&self, pubkey: &Pubkey) -> bool[src]

Trait Implementations

impl Clone for Shred[src]

impl Debug for Shred[src]

impl PartialEq<Shred> for Shred[src]

impl StructuralPartialEq for Shred[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,