Skip to content

Commit 55ab261

Browse files
committed
add README.tpl
1 parent dce3677 commit 55ab261

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

README.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# Leucite
1+
<!-- Readme generated with `cargo-readme`: https://github.com/webern/cargo-readme -->
22

3-
A wrapper crate around [`rust-landlock`](https://docs.rs/landlock) that
4-
provides useful abstractions and utilities
3+
# leucite
54

6-
## Example
5+
[![Crates.io](https://img.shields.io/crates/v/leucite.svg)](https://crates.io/crates/leucite)
6+
[![Documentation](https://docs.rs/leucite/badge.svg)](https://docs.rs/leucite/)
7+
[![Dependency status](https://deps.rs/repo/github/basalt-rs/leucite/status.svg)](https://deps.rs/repo/github/basalt-rs/leucite)
8+
9+
A wrapper crate around [`rust-landlock`](https://docs.rs/landlock) that provides useful
10+
abstractions and utilities
11+
12+
### Example
713

814
```rust
915
let rules = Rules::new()
@@ -13,11 +19,13 @@ let rules = Rules::new()
1319
.add_read_only("/bin")
1420
.add_read_write("/tmp/foo");
1521

16-
let mut child = Command::new("bash")
22+
// Execute `bash -i` in the `/tmp/foo` directory using the provided rules
23+
Command::new("bash")
1724
.arg("-i")
1825
.current_dir("/tmp/foo")
1926
.env_clear()
20-
.spawn_restricted(rules)?;
21-
22-
child.wait()?;
27+
.restrict(rules.into())
28+
.max_memory(MemorySize::from_mb(100))
29+
.spawn()?
30+
.wait()?;
2331
```

README.tpl

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- Readme generated with `cargo-readme`: https://github.com/webern/cargo-readme -->
2+
3+
# {{crate}}
4+
5+
[![Crates.io](https://img.shields.io/crates/v/leucite.svg)](https://crates.io/crates/leucite)
6+
[![Documentation](https://docs.rs/leucite/badge.svg)](https://docs.rs/leucite/)
7+
[![Dependency status](https://deps.rs/repo/github/basalt-rs/leucite/status.svg)](https://deps.rs/repo/github/basalt-rs/leucite)
8+
9+
{{readme}}

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! # Leucite
2-
//!
31
//! A wrapper crate around [`rust-landlock`](https://docs.rs/landlock) that provides useful
42
//! abstractions and utilities
53
//!

0 commit comments

Comments
 (0)