Skip to main content

scope_spawn/
lib.rs

1//!
2//! A Small utility library which aims to make structured concurrency a
3//! bit easier when used with tokio or tower.
4//!
5//! A Simple Example
6//!
7//! ```rust
8//! use scope_spawn::scope::Scope;
9//!
10//! #[tokio::main]
11//! async fn main() {
12//!     let scope = Scope::new();
13//!     scope.spawn(async {
14//!     println!("Hello from a spawned task!");
15//! });
16//! // scope is dropped here, and spawned tasks are cancelled.
17//! }
18//! ```
19#![warn(
20    missing_docs,
21    missing_debug_implementations,
22    missing_copy_implementations,
23    trivial_casts,
24    trivial_numeric_casts,
25    unsafe_code,
26    unstable_features,
27    unused_import_braces,
28    unused_qualifications
29)]
30
31pub mod scope;