Expand description
Birdcage sandbox.
This crate provides a cross-platform API for an embedded sandbox for macOS and Linux.
Example
use std::fs;
use birdcage::{Birdcage, Sandbox};
use tempfile::NamedTempFile;
// Setup our test file.
let file = NamedTempFile::new().unwrap();
// Reads without sandbox work.
fs::read_to_string(file.path()).unwrap();
// Initialize the sandbox; by default everything is prohibited.
Birdcage::new().lock().unwrap();
// Reads with sandbox should fail.
let result = fs::read_to_string(file.path());
assert!(result.is_err());
Modules
- Sandboxing errors.
Enums
- Sandboxing exception rule.
Traits
Type Aliases
- Default platform sandbox.