| Crates.io | vessel |
| lib.rs | vessel |
| version | 0.1.3 |
| created_at | 2025-05-20 09:54:22.417102+00 |
| updated_at | 2025-05-22 09:50:50.516262+00 |
| description | A context propogation struct. Carries cancellation, and other useful items transparently through an application |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1681084 |
| size | 4,273 |
vessel::Vessel is a simple, immutable value bag for Rust โ inspired by Go's context.Context, but focused solely on storing and propagating context in a simple manner.
Vessel.BTreeMap internally for deterministic iteration.use vessel::Vessel;
let vessel = Vessel::new();
let vessel = vessel.with_value("request_id", "abc-123");
assert_eq!(vessel.get_value("request_id"), Some(&"abc-123".to_string()));
pub fn new() -> Self;
pub fn with_value(&self, key: &str, value: &str) -> Self;
pub fn get_value(&self, key: &str) -> Option<&String>;
pub fn get_values(&self) -> &BTreeMap<String, String>;
with_value: Adds a key-value pair to the vessel, returning a new instance.get_value: Retrieves a value for a given key.get_values: Returns all key-value pairs.Run tests with:
cargo test
MIT