26 releases

0.7.14 Feb 26, 2025
0.7.12 Jun 24, 2024
0.7.9 Jan 25, 2024
0.7.8 Dec 20, 2023
0.2.1 Jul 14, 2021

#158 in Network programming

Download history 1833/week @ 2025-12-12 1692/week @ 2025-12-19 1071/week @ 2025-12-26 1703/week @ 2026-01-02 1239/week @ 2026-01-09 1377/week @ 2026-01-16 1315/week @ 2026-01-23 1544/week @ 2026-01-30 1628/week @ 2026-02-06 2340/week @ 2026-02-13 2484/week @ 2026-02-20 2901/week @ 2026-02-27 5353/week @ 2026-03-06 4509/week @ 2026-03-13 3561/week @ 2026-03-20 3083/week @ 2026-03-27

17,146 downloads per month
Used in 27 crates (9 directly)

MIT/Apache

360KB
1.5K SLoC

Metainfo

Crates.io Documentation License Build Status

Transmissing metainfo across components.

Quickstart

Metainfo is designed to be passed through task local, so we provided a unified key for it metainfo::METAINFO, and we recommend you to use it this way:

METAINFO.scope(...)

MetaInfo is used to passthrough information between components and even client-server.

It supports two types of info: typed map and string k-v.

It is designed to be tree-like, which means you can share a MetaInfo with multiple children.

Note: only the current scope is mutable.

Example:

use metainfo::MetaInfo;

fn test() {
    let mut m1 = MetaInfo::new();
    m1.insert::<i8>(2);
    assert_eq!(*m1.get::<i8>().unwrap(), 2);

    let (mut m1, mut m2) = m1.derive();
    assert_eq!(*m2.get::<i8>().unwrap(), 2);

    m2.insert::<i8>(4);
    assert_eq!(*m2.get::<i8>().unwrap(), 4);

    m2.remove::<i8>();
    assert_eq!(*m2.get::<i8>().unwrap(), 2);
}
  • Volo: A high-performance and strong-extensibility Rust RPC framework that helps developers build microservices.
  • Volo-rs: The volo ecosystem which contains a lot of useful components.
  • Motore: Middleware abstraction layer powered by GAT.
  • Pilota: A thrift and protobuf implementation in pure rust with high performance and extensibility.

Contributing

See CONTRIBUTING.md for more information.

License

Metainfo is dual-licensed under the MIT license and the Apache License (Version 2.0).

See LICENSE-MIT and LICENSE-APACHE for details.

Community

Dependencies

~1.5–2.5MB
~32K SLoC