Crates.io | safina |
lib.rs | safina |
version | 0.6.0 |
source | src |
created_at | 2020-12-01 07:20:18.177493 |
updated_at | 2024-11-03 04:31:48.782463 |
description | Safe async runtime |
homepage | |
repository | https://gitlab.com/leonhard-llc/safina-rs |
max_upload_size | |
id | 318489 |
size | 252,180 |
A safe Rust async runtime.
forbid(unsafe_code)
std
at runtimefs
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.use std::sync::Arc;
use safina::executor::Executor;
let executor: Arc<Executor> = Arc::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
})?;
unsafe
codeunsafe
codeunsafe
codeunsafe
codeunsafe
codenostd_async
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.6.0
0/0 0/0 0/0 0/0 0/0 🔒 └── safina-macros 0.1.3
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
ExecutorBuilder
.ExecutorBuilder
and simplify Executor
constructors.async_test
:
async_test
a default feature so it shows up in docs.rs.#[async_test(timeout_sec = 1)]
.#[should_panic]
and other test modifier macros._
to the end of the test name.threadpool
module.sync_channel
and SyncSender
.Receiver::async_recv
to let users await without writing ugly (&mut receiver).await
.Receiver::blocking
and add try_recv
, recv
, etc.Promise
with oneshot
, OneSender
, and Receiver
that supports async and blocking reads.schedule_blocking
to return new sync::Receiver
.Executor::new
and Executor::with_name
to return Result
.ThreadPool::new
to return Result
.ThreadPool::try_schedule
to return an error when it fails to restart panicked threads.ThreadPool::schedule
to handle failure starting replacement threads.block_on
functions to take futures that are not Send
.once_cell
by default.once_cell
.safina::sync::Mutex
Box::pin
.safina
crate to safina-executor
.
Added new safina
crate with re-exports, examples, and integration tests.init
function that makes an executor and starts the timer thread.#[async_main]
macroLicense: Apache-2.0