https://github.com/pimalaya/io-keyring
Set of I/O-free Rust coroutines and runtimes to manage keyring entries
https://github.com/pimalaya/io-keyring
coroutine io-free keychain keyring library runtime rust sans-io
Last synced: about 1 year ago
JSON representation
Set of I/O-free Rust coroutines and runtimes to manage keyring entries
- Host: GitHub
- URL: https://github.com/pimalaya/io-keyring
- Owner: pimalaya
- License: mit
- Created: 2024-12-14T00:17:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-03T21:59:13.000Z (about 1 year ago)
- Last Synced: 2025-06-04T06:08:52.273Z (about 1 year ago)
- Topics: coroutine, io-free, keychain, keyring, library, runtime, rust, sans-io
- Language: Rust
- Homepage: https://docs.rs/io-keyring/latest/io_keyring
- Size: 277 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# I/O Keyring [](https://docs.rs/io-keyring/latest/io_keyring) [](https://matrix.to/#/#pimalaya:matrix.org)
Set of **I/O-free** Rust coroutines and runtimes to manage keyring entries.
This library allows you to manage keyring entries using an I/O-agnostic approach, based on 3 concepts:
### Coroutine
A coroutine is an *I/O-free*, *resumable* and *composable* state machine that **emits I/O requests**. A coroutine is considered *terminated* when it does not emit I/O requests anymore.
*See available coroutines at [./src/coroutines](https://github.com/pimalaya/io-keyring/tree/master/src/coroutines).*
### Runtime
A runtime contains all the I/O logic, and is responsible for **processing I/O requests** emitted by coroutines.
*See available runtimes at [./src/runtimes](https://github.com/pimalaya/io-keyring/tree/master/src/runtimes).*
### Loop
The loop is the glue between coroutines and runtimes. It makes the coroutine progress while allowing runtime to process I/O.
## Examples
*See complete examples at [./examples](https://github.com/pimalaya/io-keyring/blob/master/examples).*
### Read secret from entry synchronously
```rust,ignore
use io_keyring::{coroutines::Read, handlers::std::handle};
let entry = Entry::new("name").service("example");
let mut arg = None;
let mut read = Read::new(entry.clone());
let secret = loop {
match read.resume(arg) {
Ok(secret) => break secret,
Err(io) => arg = Some(handle(io).unwrap()),
}
};
```
### Write secret into entry synchronously
```rust,ignore
use io_keyring::{coroutines::Write, handlers::std::handle};
let entry = Entry::new("name").service("example");
let mut arg = None;
let mut write = Write::new(entry, "password");
while let Err(io) = write.resume(arg) {
arg = Some(handle(io).unwrap());
}
```
### Delete secret from entry synchronously
```rust,ignore
use io_keyring::{coroutines::Delete, handlers::std::handle};
let entry = Entry::new("name").service("example");
let mut arg = None;
let mut Delete = Delete::new(entry);
while let Err(io) = delete.resume(arg) {
arg = Some(handle(io).unwrap());
}
```
### More examples
Have a look at projects built on the top of this library:
- *TODO*
## Sponsoring
[](https://nlnet.nl/)
Special thanks to the [NLnet foundation](https://nlnet.nl/) and the [European Commission](https://www.ngi.eu/) that helped the project to receive financial support from various programs:
- [NGI Assure](https://nlnet.nl/project/Himalaya/) in 2022
- [NGI Zero Entrust](https://nlnet.nl/project/Pimalaya/) in 2023
- [NGI Zero Core](https://nlnet.nl/project/Pimalaya-PIM/) in 2024 *(still ongoing)*
If you appreciate the project, feel free to donate using one of the following providers:
[](https://github.com/sponsors/soywod)
[](https://ko-fi.com/soywod)
[](https://www.buymeacoffee.com/soywod)
[](https://liberapay.com/soywod)
[](https://thanks.dev/soywod)
[](https://www.paypal.com/paypalme/soywod)