pub struct RuleBuilder { /* private fields */ }Expand description
Builder for creating YARA rules
Implementations§
Source§impl RuleBuilder
impl RuleBuilder
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Add metadata to the rule
Sourcepub fn with_string(
self,
identifier: &str,
pattern: &str,
) -> Result<Self, YaraError>
pub fn with_string( self, identifier: &str, pattern: &str, ) -> Result<Self, YaraError>
Add a string pattern to the rule
Sourcepub fn with_hex(self, identifier: &str, hex: &str) -> Result<Self, YaraError>
pub fn with_hex(self, identifier: &str, hex: &str) -> Result<Self, YaraError>
Add a hex pattern to the rule
Sourcepub fn with_condition(self, condition: &str) -> Self
pub fn with_condition(self, condition: &str) -> Self
Set the condition for the rule
Trait Implementations§
Source§impl Default for RuleBuilder
impl Default for RuleBuilder
Source§fn default() -> RuleBuilder
fn default() -> RuleBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RuleBuilder
impl RefUnwindSafe for RuleBuilder
impl Send for RuleBuilder
impl Sync for RuleBuilder
impl Unpin for RuleBuilder
impl UnwindSafe for RuleBuilder
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> 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