pub struct ValueTransform {
pub op: ValueTransformOp,
pub operand: i64,
}Expand description
A pre-comparison value transform: (op, operand).
Applied to the value read from the file before the rule’s comparison
operator runs. See ValueTransformOp for the supported operations.
§Examples
use libmagic_rs::parser::ast::{ValueTransform, ValueTransformOp};
// `lelong+1` -> add 1 to the read value
let t = ValueTransform { op: ValueTransformOp::Add, operand: 1 };
assert_eq!(t.op, ValueTransformOp::Add);
assert_eq!(t.operand, 1);Fields§
§op: ValueTransformOpOperation to apply.
operand: i64Operand to combine with the read value.
Trait Implementations§
Source§impl Clone for ValueTransform
impl Clone for ValueTransform
Source§fn clone(&self) -> ValueTransform
fn clone(&self) -> ValueTransform
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValueTransform
impl Debug for ValueTransform
Source§impl<'de> Deserialize<'de> for ValueTransform
impl<'de> Deserialize<'de> for ValueTransform
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
Source§impl PartialEq for ValueTransform
impl PartialEq for ValueTransform
Source§impl Serialize for ValueTransform
impl Serialize for ValueTransform
impl Copy for ValueTransform
impl Eq for ValueTransform
impl StructuralPartialEq for ValueTransform
Auto Trait Implementations§
impl Freeze for ValueTransform
impl RefUnwindSafe for ValueTransform
impl Send for ValueTransform
impl Sync for ValueTransform
impl Unpin for ValueTransform
impl UnsafeUnpin for ValueTransform
impl UnwindSafe for ValueTransform
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