arta_async_std/
lib.rs

1//! # arta-async-std
2//! Arta-async-std is a crate that provides an implementation of `arta` abstractions for async-std runtime.
3//!
4//! ## Installation
5//! Add a following dependencies to your `Cargo.toml`:
6//! ```toml
7//! [dependencies]
8//! arta-async-std = "0.1.0"
9//! arta = "0.1.1"
10//! async-std = { version = "1.12.0", features = ["attributes"] }
11//! ```
12//! ## Usage
13//!
14//! ```ignore
15//! #[async_std::main]
16//! async fn main() {
17//!     // After async-std runtime was initialized just call methods on `AsyncStdGlobalRuntime` to use
18//!     // this crate.
19//!     // Example:
20//!     let hosts = AsyncStdGlobalRuntime.read_to_string("/etc/hosts").await.unwrap();
21//!     println!("Hosts: {hosts}");
22//! }
23//! ```
24#![deny(
25    warnings,
26    clippy::correctness,
27    clippy::suspicious,
28    clippy::complexity,
29    clippy::perf,
30    clippy::style,
31    clippy::pedantic,
32    clippy::restriction,
33    clippy::cargo
34)]
35#![allow(
36    clippy::module_name_repetitions,
37    clippy::blanket_clippy_restriction_lints,
38    clippy::missing_inline_in_public_items,
39    clippy::single_char_lifetime_names,
40    clippy::implicit_return,
41    clippy::pattern_type_mismatch,
42    clippy::question_mark_used,
43    clippy::shadow_reuse,
44    clippy::shadow_same,
45    clippy::pub_with_shorthand,
46    clippy::absolute_paths,
47    clippy::exhaustive_enums,
48    clippy::exhaustive_structs,
49    clippy::multiple_crate_versions,
50    clippy::missing_docs_in_private_items,
51    clippy::pub_use,
52    clippy::infinite_loop, // Allowed because of bug: https://github.com/rust-lang/rust-clippy/issues/12338
53    clippy::unseparated_literal_suffix,
54    clippy::self_named_module_files,
55    clippy::big_endian_bytes,
56    clippy::single_call_fn,
57    clippy::missing_trait_methods,
58    clippy::arithmetic_side_effects,
59    clippy::indexing_slicing,
60    clippy::print_stdout,
61    clippy::shadow_unrelated,
62    clippy::undocumented_unsafe_blocks,
63    clippy::as_conversions,
64    clippy::ref_as_ptr,
65    clippy::doc_markdown,
66    clippy::unwrap_used,
67    clippy::unreachable,
68    clippy::impl_trait_in_params,
69    clippy::missing_errors_doc,
70    clippy::std_instead_of_core,
71    clippy::std_instead_of_alloc,
72    clippy::alloc_instead_of_core,
73    clippy::min_ident_chars
74)]
75#![forbid(unreachable_pub, missing_docs)]
76#![cfg_attr(docsrs, feature(doc_cfg))]
77
78pub mod fs;
79pub mod net;
80pub mod process;
81pub mod task;
82mod time;
83
84/// Struct representing tokio global runtime usage.
85pub struct AsyncStdGlobalRuntime;