crates.io version license: Apache 2.0 unsafe forbidden pipeline status

permit::Permit is a struct for cancelling operations.

Use Cases

Features

Limitations

Alternatives

Related Crates

Example

Graceful shutdown: rust let top_permit = permit::Permit::new(); // Start some worker threads. for _ in 0..5 { let permit = top_permit.new_sub(); std::thread::spawn(move || { while !permit.is_revoked() { // ... } }); } wait_for_shutdown_signal(); // Revoke all thread permits and wait for them to // finish and drop their permits. top_permit .revoke() .wait_subs_timeout(Duration::from_secs(3)) .unwrap();

Cargo Geiger Safety Report

```

Metric output format: x/y x = unsafe code used by the build y = total unsafe code found in the crate

Symbols: 🔒 = No unsafe usage found, declares #![forbid(unsafecode)] ❓ = No unsafe usage found, missing #![forbid(unsafecode)] ☢️ = unsafe usage found

Functions Expressions Impls Traits Methods Dependency

0/0 0/0 0/0 0/0 0/0 🔒 permit 0.2.1

0/0 0/0 0/0 0/0 0/0

```

Changelog

License: Apache-2.0