pub struct MagicRule {
pub offset: OffsetSpec,
pub typ: TypeKind,
pub op: Operator,
pub value: Value,
pub message: String,
pub children: Vec<MagicRule>,
pub level: u32,
pub strength_modifier: Option<StrengthModifier>,
}Expand description
Magic rule representation in the AST
Fields§
§offset: OffsetSpecOffset specification for where to read data
typ: TypeKindType of data to read and interpret
op: OperatorComparison operator to apply
value: ValueExpected value for comparison
message: StringHuman-readable message for this rule
children: Vec<MagicRule>Child rules that are evaluated if this rule matches
level: u32Indentation level for hierarchical rules
strength_modifier: Option<StrengthModifier>Optional strength modifier from !:strength directive
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MagicRule
impl<'de> Deserialize<'de> for MagicRule
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 MagicRule
impl RefUnwindSafe for MagicRule
impl Send for MagicRule
impl Sync for MagicRule
impl Unpin for MagicRule
impl UnsafeUnpin for MagicRule
impl UnwindSafe for MagicRule
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