Skip to main content

Crate ytsaurus_proto

Crate ytsaurus_proto 

Source
Expand description

Generated protobuf bindings for the YTsaurus RPC proxy.

The modules under nyt are generated by prost-build from the upstream .proto files in the third_party/ytsaurus submodule — not from a copy of them. The submodule records an exact upstream commit, so the definitions are pinned without a vendored copy that could drift.

The generated Rust is committed, under src/generated/, and there is no build script. cargo package does not walk into a submodule, so generating at build time would produce a crate that builds from its own repository and fails from crates.io. Building this crate therefore needs neither the submodule nor protoc.

Regenerate with cargo xtask generate-protos, after ./scripts/init-protos.sh — which checks the submodule out shallow and sparse, so it costs about 23 MB rather than the whole monorepo. CI runs the same task and fails on a diff, so the committed code cannot drift from the pin.

prost names a module after its protobuf package, and writes generated cross-package references as super::-relative paths, so the nesting below is not a matter of taste — it has to mirror the package names exactly or the generated code does not resolve.

Everything under nyt is generated. The aliases beneath it are this crate’s own, and are the names the rest of the workspace uses.

use ytsaurus_proto::rpc::TRequestHeader;

let header = TRequestHeader {
    service: "ApiService".to_owned(),
    method: "LookupRows".to_owned(),
    ..Default::default()
};
assert_eq!(header.service, "ApiService");

Re-exports§

pub use nyt::n_api::n_rpc_proxy::n_proto as api;
pub use nyt::n_bus::n_proto as bus;
pub use nyt::n_proto as misc;
pub use nyt::n_rpc::n_proto as rpc;
pub use nyt::ny_tree::n_proto as ytree;

Modules§

nyt
Generated code, in modules mirroring the protobuf package names.