Trait bp7::crc::CrcBlock

source ·
pub trait CrcBlock: Block + Clone {
    // Required methods
    fn crc_value(&self) -> &CrcValue;
    fn set_crc(&mut self, crc: CrcValue);

    // Provided methods
    fn has_crc(&self) -> bool { ... }
    fn update_crc(&mut self) { ... }
    fn check_crc(&mut self) -> bool { ... }
    fn reset_crc(&mut self) { ... }
    fn crc(&self) -> Option<&[u8]> { ... }
    fn set_crc_type(&mut self, crc_value: CrcRawType) { ... }
    fn crc_type(&self) -> CrcRawType { ... }
}

Required Methods§

source

fn crc_value(&self) -> &CrcValue

source

fn set_crc(&mut self, crc: CrcValue)

Provided Methods§

source

fn has_crc(&self) -> bool

Convert block struct to a serializable enum

source

fn update_crc(&mut self)

Recalculate crc value

source

fn check_crc(&mut self) -> bool

Check if crc value is valid

source

fn reset_crc(&mut self)

Reset crc field to an empty value

source

fn crc(&self) -> Option<&[u8]>

Returns raw crc checksum

source

fn set_crc_type(&mut self, crc_value: CrcRawType)

Set crc type CRC_NO, CRC_16, CRC_32

source

fn crc_type(&self) -> CrcRawType

Return the crc type code

Object Safety§

This trait is not object safe.

Implementors§