pub trait BlockerSpec {
// Required methods
fn app_block_action(&self) -> &AppBlockAction;
fn escape_block_action(&self) -> &AppBlockAction;
fn should_block_task_manager(&self) -> bool;
fn should_block_terminal(&self) -> bool;
fn should_block_system_settings(&self) -> bool;
}Expand description
The BlockerSpec trait defines the interface for a blocking policy,
providing methods to specify what actions should be taken for blocking
different system features such as applications, processes, system settings,
etc. This trait contains both platform-independent and platform-specific methods.
Required Methods§
Sourcefn app_block_action(&self) -> &AppBlockAction
fn app_block_action(&self) -> &AppBlockAction
Retrieves the action to be performed when blocking an application.
This defines what happens when an app needs to be blocked, such as terminating, hiding, or restricting its access.
§Returns
AppBlockAction - the specified action to take when blocking an app.
Sourcefn escape_block_action(&self) -> &AppBlockAction
fn escape_block_action(&self) -> &AppBlockAction
Retrieves the action to be performed when the user attempts to bypass or escape the block.
This defines the action to be taken when a user tries to circumvent the blocking policy.
§Returns
AppBlockAction - the specified action to take when an escape attempt occurs.
Sourcefn should_block_task_manager(&self) -> bool
fn should_block_task_manager(&self) -> bool
Indicates whether the Task Manager (or Activity Monitor) should be blocked.
§Returns
true if Task Manager/Activity Monitor should be blocked,
false otherwise.
Sourcefn should_block_terminal(&self) -> bool
fn should_block_terminal(&self) -> bool
Indicates whether terminal applications should be blocked.
§Returns
true if terminal applications should be blocked, false otherwise.
Sourcefn should_block_system_settings(&self) -> bool
fn should_block_system_settings(&self) -> bool
Indicates whether system settings should be blocked.
§Returns
true if system settings should be blocked, false otherwise.