[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DHDEGZE9HCEZAS09N81KBV":3,"skill-same:01M7DHDEGZE9HCEZAS09N81KBV":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":13,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7DHDEGZE9HCEZAS09N81KBV","azure-eventhub-rust",null,"Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing.\nTriggers: \"event hubs rust\", \"ProducerClient rust\", \"ConsumerClient rust\", \"send event rust\", \"streaming rust\", \"eventhub rust\".","ak2dev\u002Fagentguard","ak2dev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233005497?v=4","01M7DGWK3E3XCC276C6YRFSN05","01M7DGWK4J2A9WQ44CS5CRP4R6",0,"MIT","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-eventhub-rust\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: azure-eventhub-rust\ndescription: |\n  Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing.\n  Triggers: \"event hubs rust\", \"ProducerClient rust\", \"ConsumerClient rust\", \"send event rust\", \"streaming rust\", \"eventhub rust\".\nlicense: MIT\nmetadata:\n  author: Microsoft\n  package: azure_messaging_eventhubs\n---\n\n# Azure Event Hubs library for Rust\n\nClient library for Azure Event Hubs — send and receive events for streaming data ingestion.\n\nUse this skill when:\n\n- An app needs to send events to Azure Event Hubs from Rust\n- You need to receive and process events from partitions\n- You need batch sending for throughput optimization\n- You need to control consumer start position\n\n> **IMPORTANT:** Only use the official `azure_messaging_eventhubs` crate published by the [azure-sdk](https:\u002F\u002Fcrates.io\u002Fusers\u002Fazure-sdk) crates.io user. Do NOT use unofficial or community crates. Official crates use underscores in names and none have version 0.21.0.\n\n## Installation\n\n```sh\ncargo add azure_messaging_eventhubs azure_identity tokio futures\n```\n\n> `DeveloperToolsCredential::new(None)?` already returns an `Arc\u003CDeveloperToolsCredential>`, so you can pass or clone it directly into `.open()`. Add `azure_core` only when you need direct `azure_core` imports such as `ErrorKind`.\n\n## Environment Variables\n\n```bash\nEVENTHUBS_HOST=\u003Cnamespace>.servicebus.windows.net # Required — fully qualified namespace\nEVENTHUB_NAME=\u003Ceventhub-name>                     # Required — name of the Event Hub\n```\n\n## Key Concepts\n\n| Concept       | Description                                          |\n| ------------- | ---------------------------------------------------- |\n| **Namespace** | Container for one or more Event Hubs                 |\n| **Event Hub** | Stream of events, partitioned for parallel reads     |\n| **Partition** | Ordered, append-only sequence of events              |\n| **Producer**  | Sends events via `ProducerClient`                    |\n| **Consumer**  | Receives events from partitions via `ConsumerClient` |\n\n## Authentication\n\nRust Azure SDK code must not use `DefaultAzureCredential`. The Rust identity crate does not provide that type.\n\n```rust\nuse azure_identity::DeveloperToolsCredential;\nuse azure_messaging_eventhubs::ProducerClient;\n\n#[tokio::main]\nasync fn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n    \u002F\u002F Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.\n    let credential = DeveloperToolsCredential::new(None)?;\n\n    let producer = ProducerClient::builder()\n        .open(\n            \"\u003Cnamespace>.servicebus.windows.net\",\n            \"\u003Ceventhub-name>\",\n            credential.clone(),\n        )\n        .await?;\n    Ok(())\n}\n```\n\nPrefer the crate README\u002Fexamples when checking builder signatures and receive-stream event wrapper shapes.\n\n## Core Workflow\n\n### Send Events\n\n```rust\n\u002F\u002F Send a single event\nproducer.send_event(vec![1, 2, 3, 4], None).await?;\n```\n\n### Send Batch\n\n```rust\nlet batch = producer.create_batch(None).await?;\nbatch.try_add_event_data(vec![1, 2, 3, 4], None)?;\n\nproducer.send_batch(batch, None).await?;\n```\n\n### Receive Events\n\n```rust\nuse azure_identity::DeveloperToolsCredential;\nuse azure_messaging_eventhubs::ConsumerClient;\n\n\u002F\u002F Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.\nlet credential = DeveloperToolsCredential::new(None)?;\nlet consumer = ConsumerClient::builder()\n    .open(\n        \"\u003Cnamespace>.servicebus.windows.net\",\n        \"\u003Ceventhub-name>\".to_string(),\n        credential.clone(),\n    )\n    .await?;\n```\n\n### Receive from Partition\n\n```rust\nuse futures::stream::StreamExt;\nuse azure_messaging_eventhubs::{\n    ConsumerClient, OpenReceiverOptions, StartLocation, StartPosition,\n};\n\nlet receiver = consumer\n    .open_receiver_on_partition(\n        \"0\".to_string(),\n        Some(OpenReceiverOptions {\n            start_position: Some(StartPosition {\n                location: StartLocation::Earliest,\n                ..Default::default()\n            }),\n            ..Default::default()\n        }),\n    )\n    .await?;\n\nlet mut stream = receiver.stream_events();\nwhile let Some(event_result) = stream.next().await {\n    match event_result {\n        \u002F\u002F Body is on the inner event data, not the received wrapper: `event.event_data().body()`.\n        Ok(event) => {\n            let body = event.event_data().body().unwrap_or_default();\n            println!(\"Received: {:?}\", body);\n        }\n        Err(err) => eprintln!(\"Error: {:?}\", err),\n    }\n}\n```\n\n## RBAC Roles\n\nFor Entra ID auth, assign one of these roles:\n\n| Role                             | Access         |\n| -------------------------------- | -------------- |\n| `Azure Event Hubs Data Sender`   | Send events    |\n| `Azure Event Hubs Data Receiver` | Receive events |\n| `Azure Event Hubs Data Owner`    | Full access    |\n\n## Best Practices\n\n1. **Use `cargo add` to manage dependencies, never edit `Cargo.toml` directly.** Add and remove Rust SDK dependencies with cargo commands instead of manual manifest edits.\n2. **Pass or clone credentials directly into `.open()`.** `DeveloperToolsCredential::new(None)?` already returns an `Arc`, so you do not need to annotate the binding as `Arc\u003Cdyn TokenCredential>` unless you are naming that trait object type explicitly.\n3. **Match the builder signature.** `ProducerClient::builder().open(...)` takes the hub name as `&str`, while `ConsumerClient::builder().open(...)` takes an owned `String`.\n4. **Use `DeveloperToolsCredential`** for local dev, **`ManagedIdentityCredential`** for production — Rust does not provide a single `DefaultAzureCredential` type\n5. **Never hardcode credentials** — use environment variables or managed identity\n6. **Use batching** — `create_batch` + `send_batch` for throughput optimization\n7. **Handle errors per event** — match on `Ok`\u002F`Err` in the event stream\n8. **Extract event bodies via `event.event_data().body()`**, not `event.body()` — `ReceivedEventData` wraps the underlying `EventData`.\n9. **Specify start position** — use `StartLocation::Earliest` or `StartLocation::Latest` to control where consumption begins\n10. **Run `cargo clippy -- -D warnings`** when the prompt, eval, or CI expects lint-clean output\n\n## Reference Links\n\n| Resource      | Link                                                                                          |\n| ------------- | --------------------------------------------------------------------------------------------- |\n| API Reference | https:\u002F\u002Fdocs.rs\u002Fazure_messaging_eventhubs\u002Flatest\u002Fazure_messaging_eventhubs                    |\n| crates.io     | https:\u002F\u002Fcrates.io\u002Fcrates\u002Fazure_messaging_eventhubs                                            |\n| Source Code   | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-rust\u002Ftree\u002Fmain\u002Fsdk\u002Feventhubs\u002Fazure_messaging_eventhubs |\n","# Azure Event Hubs library for Rust\n\nClient library for Azure Event Hubs — send and receive events for streaming data ingestion.\n\nUse this skill when:\n\n- An app needs to send events to Azure Event Hubs from Rust\n- You need to receive and process events from partitions\n- You need batch sending for throughput optimization\n- You need to control consumer start position\n\n> **IMPORTANT:** Only use the official `azure_messaging_eventhubs` crate published by the [azure-sdk](https:\u002F\u002Fcrates.io\u002Fusers\u002Fazure-sdk) crates.io user. Do NOT use unofficial or community crates. Official crates use underscores in names and none have version 0.21.0.\n\n## Installation\n\n```sh\ncargo add azure_messaging_eventhubs azure_identity tokio futures\n```\n\n> `DeveloperToolsCredential::new(None)?` already returns an `Arc\u003CDeveloperToolsCredential>`, so you can pass or clone it directly into `.open()`. Add `azure_core` only when you need direct `azure_core` imports such as `ErrorKind`.\n\n## Environment Variables\n\n```bash\nEVENTHUBS_HOST=\u003Cnamespace>.servicebus.windows.net # Required — fully qualified namespace\nEVENTHUB_NAME=\u003Ceventhub-name>                     # Required — name of the Event Hub\n```\n\n## Key Concepts\n\n| Concept       | Description                                          |\n| ------------- | ---------------------------------------------------- |\n| **Namespace** | Container for one or more Event Hubs                 |\n| **Event Hub** | Stream of events, partitioned for parallel reads     |\n| **Partition** | Ordered, append-only sequence of events              |\n| **Producer**  | Sends events via `ProducerClient`                    |\n| **Consumer**  | Receives events from partitions via `ConsumerClient` |\n\n## Authentication\n\nRust Azure SDK code must not use `DefaultAzureCredential`. The Rust identity crate does not provide that type.\n\n```rust\nuse azure_identity::DeveloperToolsCredential;\nuse azure_messaging_eventhubs::ProducerClient;\n\n#[tokio::main]\nasync fn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n    \u002F\u002F Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.\n    let credential = DeveloperToolsCredential::new(None)?;\n\n    let producer = ProducerClient::builder()\n        .open(\n            \"\u003Cnamespace>.servicebus.windows.net\",\n            \"\u003Ceventhub-name>\",\n            credential.clone(),\n        )\n        .await?;\n    Ok(())\n}\n```\n\nPrefer the crate README\u002Fexamples when checking builder signatures and receive-stream event wrapper shapes.\n\n## Core Workflow\n\n### Send Events\n\n```rust\n\u002F\u002F Send a single event\nproducer.send_event(vec![1, 2, 3, 4], None).await?;\n```\n\n### Send Batch\n\n```rust\nlet batch = producer.create_batch(None).await?;\nbatch.try_add_event_data(vec![1, 2, 3, 4], None)?;\n\nproducer.send_batch(batch, None).await?;\n```\n\n### Receive Events\n\n```rust\nuse azure_identity::DeveloperToolsCredential;\nuse azure_messaging_eventhubs::ConsumerClient;\n\n\u002F\u002F Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.\nlet credential = DeveloperToolsCredential::new(None)?;\nlet consumer = ConsumerClient::builder()\n    .open(\n        \"\u003Cnamespace>.servicebus.windows.net\",\n        \"\u003Ceventhub-name>\".to_string(),\n        credential.clone(),\n    )\n    .await?;\n```\n\n### Receive from Partition\n\n```rust\nuse futures::stream::StreamExt;\nuse azure_messaging_eventhubs::{\n    ConsumerClient, OpenReceiverOptions, StartLocation, StartPosition,\n};\n\nlet receiver = consumer\n    .open_receiver_on_partition(\n        \"0\".to_string(),\n        Some(OpenReceiverOptions {\n            start_position: Some(StartPosition {\n                location: StartLocation::Earliest,\n                ..Default::default()\n            }),\n            ..Default::default()\n        }),\n    )\n    .await?;\n\nlet mut stream = receiver.stream_events();\nwhile let Some(event_result) = stream.next().await {\n    match event_result {\n        \u002F\u002F Body is on the inner event data, not the received wrapper: `event.event_data().body()`.\n        Ok(event) => {\n            let body = event.event_data().body().unwrap_or_default();\n            println!(\"Received: {:?}\", body);\n        }\n        Err(err) => eprintln!(\"Error: {:?}\", err),\n    }\n}\n```\n\n## RBAC Roles\n\nFor Entra ID auth, assign one of these roles:\n\n| Role                             | Access         |\n| -------------------------------- | -------------- |\n| `Azure Event Hubs Data Sender`   | Send events    |\n| `Azure Event Hubs Data Receiver` | Receive events |\n| `Azure Event Hubs Data Owner`    | Full access    |\n\n## Best Practices\n\n1. **Use `cargo add` to manage dependencies, never edit `Cargo.toml` directly.** Add and remove Rust SDK dependencies with cargo commands instead of manual manifest edits.\n2. **Pass or clone credentials directly into `.open()`.** `DeveloperToolsCredential::new(None)?` already returns an `Arc`, so you do not need to annotate the binding as `Arc\u003Cdyn TokenCredential>` unless you are naming that trait object type explicitly.\n3. **Match the builder signature.** `ProducerClient::builder().open(...)` takes the hub name as `&str`, while `ConsumerClient::builder().open(...)` takes an owned `String`.\n4. **Use `DeveloperToolsCredential`** for local dev, **`ManagedIdentityCredential`** for production — Rust does not provide a single `DefaultAzureCredential` type\n5. **Never hardcode credentials** — use environment variables or managed identity\n6. **Use batching** — `create_batch` + `send_batch` for throughput optimization\n7. **Handle errors per event** — match on `Ok`\u002F`Err` in the event stream\n8. **Extract event bodies via `event.event_data().body()`**, not `event.body()` — `ReceivedEventData` wraps the underlying `EventData`.\n9. **Specify start position** — use `StartLocation::Earliest` or `StartLocation::Latest` to control where consumption begins\n10. **Run `cargo clippy -- -D warnings`** when the prompt, eval, or CI expects lint-clean output\n\n## Reference Links\n\n| Resource      | Link                                                                                          |\n| ------------- | --------------------------------------------------------------------------------------------- |\n| API Reference | https:\u002F\u002Fdocs.rs\u002Fazure_messaging_eventhubs\u002Flatest\u002Fazure_messaging_eventhubs                    |\n| crates.io     | https:\u002F\u002Fcrates.io\u002Fcrates\u002Fazure_messaging_eventhubs                                            |\n| Source Code   | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-rust\u002Ftree\u002Fmain\u002Fsdk\u002Feventhubs\u002Fazure_messaging_eventhubs |\n",{"name":5,"license":14,"metadata":23,"description":26},{"author":24,"package":25},"Microsoft","azure_messaging_eventhubs","Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing.\nTriggers: \"event hubs rust\", \"ProducerClient rust\", \"ConsumerClient rust\", \"send event rust\", \"streaming rust\", \"eventhub rust\".\n","main","634c25395a24b98cd6125453ad4abb65517bcabb","bench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-eventhub-rust","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard","https:\u002F\u002Fsite-bionic8.vercel.app","https:\u002F\u002Fgithub.com\u002Fak2dev","2026-11-11 02:37:06",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ak2dev\u002Fagentguard --skill azure-eventhub-rust",{"tool":40,"command":41},"bunx","bunx skills add ak2dev\u002Fagentguard --skill azure-eventhub-rust",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ak2dev\u002Fagentguard --skill azure-eventhub-rust","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-azure-eventhub-rust\u002FSKILL.md",true,[],[49,57,62,67,72,78],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M7DJ7GBSJBJ32GXNQXVAMNYK","csv-tool","Summarize CSV files and report column statistics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fpositive\u002Ffault\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":58,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7DJ7F00PA7EHFM39RVCC8R5","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fnegative\u002Fnormal\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":63,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7DJ7DP7KDW7MYY5Q0R0JFEN","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fpositive\u002Ftoo-large\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":68,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7DJ7C3VA0KQ8Q9ESNX6AJHE","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fnegative\u002Fsmall\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7DJ7AQZTGY5YADQX73TRB7K","pdf","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fpositive\u002Fother-publisher\u002Fpdf\u002FSKILL.md",[],[],{"skillNo":79,"name":74,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7DJ7831XDVWS4W9SAAKBJHX","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fnegative\u002Fsame-publisher\u002Fpdf\u002FSKILL.md",[],[]]