safina 0.4.1

Safe async runtime
Documentation

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

A safe Rust async runtime.

Features

  • forbid(unsafe_code)
  • Depends only on std
  • Good test coverage (>95%)

Limitations

  • No fs module yet. async-fs is a fast async networking library that works well with Safina. It contains some unsafe code.
  • net module has poor performance. async-net is a fast async networking library that works well with Safina. It contains some unsafe code.
  • Not optimized

Examples

let executor = safina::executor::Executor::default();
let (sender, receiver) = std::sync::mpsc::channel();
executor.spawn(async move {
    sender.send(()).unwrap();
});
receiver.recv().unwrap();
let result = safina::executor::block_on(async {
    prepare_request().await?;
    execute_request().await
})?;

Alternatives

  • smol
    • Popular
    • Contains some unsafe code
  • async-std
    • Very popular
    • Contains generous amounts of unsafe code
  • futures
    • Very popular
    • Contains generous amounts of unsafe code
  • tokio
    • Very popular
    • Fast
    • Internally extremely complicated
    • Full of unsafe code
  • bastion
    • Generous amounts of unsafe code
  • nostd_async

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(unsafe_code)]
    ❓  = No `unsafe` usage found, missing #![forbid(unsafe_code)]
    ☢️  = `unsafe` usage found

Functions  Expressions  Impls  Traits  Methods  Dependency

0/0        0/0          0/0    0/0     0/0      🔒  safina 0.4.1
0/0        0/0          0/0    0/0     0/0      🔒  └── safina-macros 0.1.1
0/0        0/0          0/0    0/0     0/0      🔒      ├── safe-proc-macro2 1.0.67
0/0        4/4          0/0    0/0     0/0      ☢️      │   └── unicode-ident 1.0.13
0/0        0/0          0/0    0/0     0/0      🔒      └── safe-quote 1.0.15
0/0        0/0          0/0    0/0     0/0      🔒          └── safe-proc-macro2 1.0.67

0/0        4/4          0/0    0/0     0/0    

Changelog

TO DO

  • Add init function that makes an executor and starts the timer thread.
  • Add an #[async_main] macro

License: Apache-2.0