fn erasure_block(self) -> Vec<u8> {
        let shred_type = self.shred_type();
        let mut block = self.payload;
        match shred_type {
            ShredType::Data => {
                // SIZE_OF_CODING_SHRED_HEADERS bytes at the end of data shreds
                // is never used and is not part of erasure coding.
                let size = SHRED_PAYLOAD_SIZE - SIZE_OF_CODING_SHRED_HEADERS;
                block.resize(size, 0u8);
            }
            ShredType::Code => {
                // SIZE_OF_CODING_SHRED_HEADERS bytes at the beginning of the
                // coding shreds contains the header and is not part of erasure
                // coding.
                let offset = SIZE_OF_CODING_SHRED_HEADERS.min(block.len());
                block.drain(..offset);
            }
        }
        block
    }
// Returns the portion of the shred's payload which is erasure coded.
Returns the portion of the shred's payload which is erasure coded.
Returns the portion of the shred ' s payload which is erasure coded .
fn erasure_block(self) -> Vec<u8> {
        let shred_type = self.shred_type();
        let mut block = self.payload;
        match shred_type {
            ShredType::Data => {
                // SIZE_OF_CODING_SHRED_HEADERS bytes at the end of data shreds
                // is never used and is not part of erasure coding.
                let size = SHRED_PAYLOAD_SIZE - SIZE_OF_CODING_SHRED_HEADERS;
                block.resize(size, 0u8);
            }
            ShredType::Code => {
                // SIZE_OF_CODING_SHRED_HEADERS bytes at the beginning of the
                // coding shreds contains the header and is not part of erasure
                // coding.
                let offset = SIZE_OF_CODING_SHRED_HEADERS.min(block.len());
                block.drain(..offset);
            }
        }
        block
    }
fn erasure_block ( self ) -> Vec < u8 > { let shred_type = self . shred_type ( ) ; let mut block = self . payload ; match shred_type { ShredType :: Data => { // SIZE_OF_CODING_SHRED_HEADERS bytes at the end of data shreds // is never used and is not part of erasure coding. let size = SHRED_PAYLOAD_SIZE - SIZE_OF_CODING_SHRED_HEADERS ; block . resize ( size , 0u8 ) ; } ShredType :: Code => { // SIZE_OF_CODING_SHRED_HEADERS bytes at the beginning of the // coding shreds contains the header and is not part of erasure // coding. let offset = SIZE_OF_CODING_SHRED_HEADERS . min ( block . len ( ) ) ; block . drain ( .. offset ) ; } } block }
Returns the portion of the shred's payload which is erasure coded.
Returns the portion of the shred ' s payload which is erasure coded .
self