capsec 0.2.2

Compile-time capability-based security for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// A Cap<(FsRead, NetConnect)> must not satisfy Has<FsWrite>.
/// Tuple caps only grant the permissions they contain.
use capsec::prelude::*;

fn needs_write(_: &impl Has<FsWrite>) {}

fn main() {
    let root = capsec::root();
    let cap = root.grant::<(FsRead, NetConnect)>();
    needs_write(&cap);
}