Skip to content

한국어 | English

Rust binding spec · Rust binding guide

Rust bindings reference

The writing rules follow the Reference-writing guide (Korean-only). This is the bindings layer (the Core C ABI's language projection) — not the framework layer, which has its own reference tree under framework/doc/framework/rust/reference/.

Categories follow the .NET binding spec's Contract Folder Layout as the common architecture map. As with every wrapper binding so far, this tree has five categories, not six — src/contracts/ has no service/ module; SPOT/Actor exists only at the framework layer. The Contract-source column below is verified against the actual file listing, not copied from spec prose.

Rust-specific notes carried into every category below:

  • The factory/utility free functions (version, has, proxy, sleep, poll, ...) are not declared under contracts/core/ at all — they are plain functions at the crate root (bindings/rust/src/lib.rs), the idiomatic Rust equivalent of node's package-root export style, rather than a static facade type (dotnet's Zlink, java's Zlink) or free functions in a dedicated namespace (cpp's zlink::).
  • There is no shared cross-socket-type base trait. Every concrete socket is a standalone struct with its own inherent impl block; bind/connect/unbind/disconnect/TLS methods are redeclared independently (or via an internal macro for the four PUB/SUB/XPUB/XSUB types) rather than inherited from a shared Socket/ConnectableSocket trait the way every other language covered so far provides. Pollable/Monitorable are the only cross-cutting traits, and both are sealed — a crate consumer cannot implement either for a custom type.
  • ZlinkError is a Rust enum wrapping each typed error variant (Submit(SubmitError), Request(RequestError), ...), not an inheritance base class — the idiomatic Rust shape for "one of several typed errors."
  • Request submission has both async and blocking terminalsRequestOp::submit() returns a runtime-independent Future, while submit_sync() blocks and returns the caller-owned reply messages. Neither terminal installs a callback.

Locale convention

Every bindings/doc/spec/<lang>/ document is English-original, Korean-translation (unlike the framework's interface-catalog convention). This reference tree follows the same direction: write .en.md first, .ko.md second, and every spec citation links to the same-locale spec file.

Category

Category Status Contract source (verified against src/contracts/ + src/lib.rs)
Core Drafted src/lib.rs (free functions); contracts/core/: context.rs, routing_id.rs, utilities.rs
Messaging Drafted contracts/messaging/: message.rs, received.rs, topic_message.rs, subscription_event.rs, operation_contracts.rs, operations.rs
Sockets Drafted contracts/sockets/: socket.rs, message_socket_contracts.rs, routed_socket_contracts.rs, pubsub_socket_contracts.rs, stream_socket.rs, socket_options.rs
Eventing Drafted contracts/eventing/: poller.rs (also owns Timer), monitor.rs
Errors Drafted contracts/errors/: errors.rs, results.rs

This document tree is wired into mkdocs.yml nav.