{"id":19674725,"url":"https://github.com/cloudwego/metainfo","last_synced_at":"2025-04-07T13:07:20.571Z","repository":{"id":58375093,"uuid":"524982026","full_name":"cloudwego/metainfo","owner":"cloudwego","description":"Transmissing metainfo across components.","archived":false,"fork":false,"pushed_at":"2025-02-26T13:22:17.000Z","size":397,"stargazers_count":17,"open_issues_count":2,"forks_count":9,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-28T14:22:36.979Z","etag":null,"topics":["rust","volo"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/metainfo","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudwego.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-15T12:40:30.000Z","updated_at":"2025-02-26T13:22:21.000Z","dependencies_parsed_at":"2024-01-25T11:11:48.363Z","dependency_job_id":"c58166a8-e887-4943-a667-6e8e97a0a2aa","html_url":"https://github.com/cloudwego/metainfo","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":0.2727272727272727,"last_synced_commit":"0382a93dbade8792a60d24b97f74cde0330ab4f2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwego%2Fmetainfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwego%2Fmetainfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwego%2Fmetainfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwego%2Fmetainfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudwego","download_url":"https://codeload.github.com/cloudwego/metainfo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","volo"],"created_at":"2024-11-11T17:19:34.048Z","updated_at":"2025-04-07T13:07:20.548Z","avatar_url":"https://github.com/cloudwego.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metainfo\n\n[![Crates.io](https://img.shields.io/crates/v/metainfo)](https://crates.io/crates/metainfo)\n[![Documentation](https://docs.rs/metainfo/badge.svg)](https://docs.rs/metainfo)\n[![License](https://img.shields.io/crates/l/metainfo)](#license)\n[![Build Status][actions-badge]][actions-url]\n\n[actions-badge]: https://github.com/cloudwego/metainfo/actions/workflows/ci.yaml/badge.svg\n[actions-url]: https://github.com/cloudwego/metainfo/actions\n\nTransmissing metainfo across components.\n\n## Quickstart\n\nMetainfo 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:\n\n```rust\nMETAINFO.scope(...)\n```\n\n`MetaInfo` is used to passthrough information between components and even client-server.\n\nIt supports two types of info: typed map and string k-v.\n\nIt is designed to be tree-like, which means you can share a `MetaInfo` with multiple children.\n\nNote: only the current scope is mutable.\n\nExample:\n\n```rust\nuse metainfo::MetaInfo;\n\nfn test() {\n    let mut m1 = MetaInfo::new();\n    m1.insert::\u003ci8\u003e(2);\n    assert_eq!(*m1.get::\u003ci8\u003e().unwrap(), 2);\n\n    let (mut m1, mut m2) = m1.derive();\n    assert_eq!(*m2.get::\u003ci8\u003e().unwrap(), 2);\n\n    m2.insert::\u003ci8\u003e(4);\n    assert_eq!(*m2.get::\u003ci8\u003e().unwrap(), 4);\n\n    m2.remove::\u003ci8\u003e();\n    assert_eq!(*m2.get::\u003ci8\u003e().unwrap(), 2);\n}\n```\n\n## Related Projects\n\n- [Volo][Volo]: A high-performance and strong-extensibility Rust RPC framework that helps developers build microservices.\n- [Volo-rs][Volo-rs]: The volo ecosystem which contains a lot of useful components.\n- [Motore][Motore]: Middleware abstraction layer powered by GAT.\n- [Pilota][Pilota]: A thrift and protobuf implementation in pure rust with high performance and extensibility.\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/cloudwego/metainfo/blob/main/CONTRIBUTING.md) for more information.\n\n## License\n\nMetainfo is dual-licensed under the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-MIT](https://github.com/cloudwego/metainfo/blob/main/LICENSE-MIT) and [LICENSE-APACHE](https://github.com/cloudwego/metainfo/blob/main/LICENSE-APACHE) for details.\n\n## Community\n\n- Email: [volo@cloudwego.io](mailto:volo@cloudwego.io)\n- How to become a member: [COMMUNITY MEMBERSHIP](https://github.com/cloudwego/community/blob/main/COMMUNITY_MEMBERSHIP.md)\n- Issues: [Issues](https://github.com/cloudwego/metainfo/issues)\n- Feishu: Scan the QR code below with [Feishu](https://www.feishu.cn/) or [click this link](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=b34v5470-8e4d-4c7d-bf50-8b2917af026b) to join our CloudWeGo Volo user group.\n\n  \u003cimg src=\"https://github.com/cloudwego/metainfo/raw/main/.github/assets/volo-feishu-user-group.png\" alt=\"Volo user group\" width=\"50%\" height=\"50%\" /\u003e\n\n[Volo]: https://github.com/cloudwego/volo\n[Volo-rs]: https://github.com/volo-rs\n[Motore]: https://github.com/cloudwego/motore\n[Pilota]: https://github.com/cloudwego/pilota\n[Metainfo]: https://github.com/lust-rs/metainfo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudwego%2Fmetainfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudwego%2Fmetainfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudwego%2Fmetainfo/lists"}