pub struct CrcConfig {
pub location: Option<CrcLocation>,
pub polynomial: Option<u32>,
pub start: Option<u32>,
pub xor_out: Option<u32>,
pub ref_in: Option<bool>,
pub ref_out: Option<bool>,
pub area: Option<CrcArea>,
}Expand description
Unified CRC configuration used in both [settings.crc] and [header.crc].
All fields are optional; header values override settings values.
At settings level, location must be “end_data” or “end_block” (not an address).
Fields§
§location: Option<CrcLocation>§polynomial: Option<u32>§start: Option<u32>§xor_out: Option<u32>§ref_in: Option<bool>§ref_out: Option<bool>§area: Option<CrcArea>Implementations§
Source§impl CrcConfig
impl CrcConfig
Sourcepub fn resolve(&self, base: Option<&CrcConfig>) -> CrcConfig
pub fn resolve(&self, base: Option<&CrcConfig>) -> CrcConfig
Merge this config with a base config. Self takes precedence.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if CRC is disabled (location not set).
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if all required CRC parameters are present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CrcConfig
impl<'de> Deserialize<'de> for CrcConfig
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 CrcConfig
impl RefUnwindSafe for CrcConfig
impl Send for CrcConfig
impl Sync for CrcConfig
impl Unpin for CrcConfig
impl UnsafeUnpin for CrcConfig
impl UnwindSafe for CrcConfig
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> 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