pub struct SafetyContext { /* private fields */ }
Expand description

A struct representing a set of rules to be loaded into a seccomp filter and applied to the current thread, or all threads in the current process.

Create with new(). Add RuleSets with enable(), and then use apply_to_current_thread() to apply the filters to the current thread, or apply_to_all_threads() to apply the filter to all threads in the process.

Implementations

Create a new SafetyContext. The seccomp filters will not be loaded until either apply_to_current_thread or apply_to_all_threads is called.

Enable the simple and conditional rules provided by the RuleSet.

Errors

Will return ExtraSafeError::ConditionalNoEffectError if a conditional rule is enabled at the same time as a simple rule for a syscall, which would override the conditional rule.

Load the SafetyContext’s rules into a seccomp filter and apply the filter to the current thread.

Errors

May return ExtraSafeError::SeccompError.

Load the SafetyContext’s rules into a seccomp filter and apply the filter to all threads in this process.

Errors

May return ExtraSafeError::SeccompError.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.