pub struct SeccompilerRule { /* private fields */ }Expand description
Rule that a filter attempts to match for a syscall.
If all conditions match then rule gets matched.
A syscall can have many rules associated. If either of them matches, the match_action of the
SeccompFilter is triggered.
Implementations§
Source§impl SeccompRule
impl SeccompRule
Sourcepub fn new(conditions: Vec<SeccompCondition>) -> Result<SeccompRule, Error>
pub fn new(conditions: Vec<SeccompCondition>) -> Result<SeccompRule, Error>
Creates a new rule. Rules with 0 conditions are not allowed.
§Arguments
conditions- Vector ofSeccompConditions that the syscall must match.
§Example
use seccompiler::{SeccompCmpArgLen, SeccompCmpOp, SeccompCondition, SeccompRule};
let rule = SeccompRule::new(vec![
SeccompCondition::new(0, SeccompCmpArgLen::Dword, SeccompCmpOp::Eq, 1).unwrap(),
SeccompCondition::new(1, SeccompCmpArgLen::Dword, SeccompCmpOp::Eq, 1).unwrap(),
])
.unwrap();Trait Implementations§
Source§impl Clone for SeccompRule
impl Clone for SeccompRule
Source§fn clone(&self) -> SeccompRule
fn clone(&self) -> SeccompRule
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 SeccompRule
impl Debug for SeccompRule
Source§impl From<SeccompRule> for Vec<sock_filter>
impl From<SeccompRule> for Vec<sock_filter>
Source§fn from(rule: SeccompRule) -> Vec<sock_filter>
fn from(rule: SeccompRule) -> Vec<sock_filter>
Converts to this type from the input type.
Source§impl PartialEq for SeccompRule
impl PartialEq for SeccompRule
impl Eq for SeccompRule
impl StructuralPartialEq for SeccompRule
Auto Trait Implementations§
impl Freeze for SeccompRule
impl RefUnwindSafe for SeccompRule
impl Send for SeccompRule
impl Sync for SeccompRule
impl Unpin for SeccompRule
impl UnwindSafe for SeccompRule
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