pub struct FecChunk {
pub index: u32,
pub total_chunks: u32,
pub data_chunks: u32,
pub data: Vec<u8>,
pub size: usize,
pub block_hash: Hash,
pub sequence: u64,
pub magic: [u8; 4],
}Expand description
FEC chunk with full metadata for FIBRE transmission
Fields§
§index: u32Chunk index (0-based, includes both data and parity shards)
total_chunks: u32Total number of chunks (data + parity)
data_chunks: u32Number of data chunks (before parity)
data: Vec<u8>Chunk data (FEC-encoded shard)
size: usizeChunk size in bytes
block_hash: HashBlock hash (for validation and assembly)
sequence: u64Sequence number (for ordering and duplicate detection)
magic: [u8; 4]Magic bytes for packet validation
Implementations§
Source§impl FecChunk
impl FecChunk
Sourcepub fn serialize(&self) -> Result<Vec<u8>, FibreProtocolError>
pub fn serialize(&self) -> Result<Vec<u8>, FibreProtocolError>
Serialize chunk to FIBRE packet format
Sourcepub fn deserialize(data: &[u8]) -> Result<Self, FibreProtocolError>
pub fn deserialize(data: &[u8]) -> Result<Self, FibreProtocolError>
Deserialize chunk from FIBRE packet format
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FecChunk
impl<'de> Deserialize<'de> for FecChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FecChunk
impl RefUnwindSafe for FecChunk
impl Send for FecChunk
impl Sync for FecChunk
impl Unpin for FecChunk
impl UnsafeUnpin for FecChunk
impl UnwindSafe for FecChunk
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§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> 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>
Converts
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>
Converts
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