| Crates.io | safina |
| lib.rs | safina |
| version | 0.7.0 |
| created_at | 2020-12-01 07:20:18.177493+00 |
| updated_at | 2025-07-01 02:45:43.71787+00 |
| description | Safe async runtime |
| homepage | |
| repository | https://gitlab.com/leonhard-llc/safina-rs |
| max_upload_size | |
| id | 318489 |
| size | 262,834 |
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.% cargo run --release --package bench
scheduler_bench_ms tokio=9751
scheduler_bench_ms safina=7595
timer_bench_ms tokio=765
timer_bench_ms safina=5045
mutex_bench_ms tokio=782
mutex_bench_ms safina=4221
oneshot_bench_ms tokio=673
oneshot_bench_ms safina=2511
bounded_channel_bench_ms tokio=756
bounded_channel_bench_ms safina=2409
tcp_bench_ms tokio=92
tcp_bench_ms safina=4153
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.7.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.95
0/0 0/0 0/0 0/0 0/0 🔒 │ └── unicode-xid 0.2.6
0/0 0/0 0/0 0/0 0/0 🔒 └── safe-quote 1.0.40
0/0 0/0 0/0 0/0 0/0 🔒 └── safe-proc-macro2 1.0.95
0/0 0/0 0/0 0/0 0/0
OptionAb::into_a], etc.TryScheduleError::QueueFull.SyncSender] no longer requires Clone.Executor::get_thread_executor_weak].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::MutexBox::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] macrosafina::sync::unbounded_channel()License: Apache-2.0