Rust SDK
net-mesh-sdk is the native Rust API. It exposes both the event bus and the
capability-oriented mesh surface without a language binding between your code and
the runtime.
▸ shell
cargo add net-mesh-sdkThe crate imports as net_sdk.
Choose the entry point
Netis the event bus. Useemitandsubscribe_typedwith a memory, mesh, Redis, or JetStream transport.Meshprovides capabilities, tools, and nRPC. Use it to announce work, discover providers, and invoke them.
Follow the capability path
Protected services
Two authority surfaces sit on top of the mesh, both marshaling-free in Rust:
- Organization auth (concepts) —
mesh.serve_org(service, OrgAccess::…, handler)on the provider,mesh.org(credentials)?.call(service, &req)on the caller. The service is invisible outside its audience, not merely refused. - Subnet authority (concepts) — a provider inside
a protected subnet exports one service against a named export configured on
the builder (
.subnet_export(..)):mesh.serve_subnet_exported(service, export_name, handler). The caller stays an ordinary org client and usesorg.call_exported(service, &req)— it never joins the provider's subnet. Runtime gateway administration lives undernet_sdk::subnet::admin.
Every signed artifact for either surface is minted offline by
net-mesh org / net-mesh subnet; nothing in the SDK
signs.
Runnable examples live under sdk/examples/. Use Concepts for
the model and this section for Rust call shapes and lifecycle.