From 7b48938711dab22b7d45e105f98d7622cfb72ccc Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 10 Dec 2024 23:07:15 -0800 Subject: [PATCH] Regenerate documentation --- docs/src/rust_prost.md | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/src/rust_prost.md b/docs/src/rust_prost.md index f74039b576..b6b816bc61 100644 --- a/docs/src/rust_prost.md +++ b/docs/src/rust_prost.md @@ -192,3 +192,57 @@ Rust Prost toolchain rule. | tonic_runtime | The Tonic runtime crates to use. | Label | optional | `None` | + + +## rust_prost_transform + +
+rust_prost_transform(name, deps, srcs, prost_opts, tonic_opts)
+
+ +A rule for transforming the outputs of `ProstGenProto` actions. + +This rule is used by adding it to the `data` attribute of `proto_library` targets. E.g. +```python +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_rust_prost//:defs.bzl", "rust_prost_library", "rust_prost_transform") + +rust_prost_transform( + name = "a_transform", + srcs = [ + "a_src.rs", + ], +) + +proto_library( + name = "a_proto", + srcs = [ + "a.proto", + ], + data = [ + ":transform", + ], +) + +rust_prost_library( + name = "a_rs_proto", + proto = ":a_proto", +) +``` + +The `rust_prost_library` will spawn an action on the `a_proto` target which consumes the +`a_transform` rule to provide a means of granularly modifying a proto library for `ProstGenProto` +actions with minimal impact to other consumers. + +**ATTRIBUTES** + + +| Name | Description | Type | Mandatory | Default | +| :------------- | :------------- | :------------- | :------------- | :------------- | +| name | A unique name for this target. | Name | required | | +| deps | Additional dependencies to add to the compiled crate. | List of labels | optional | `[]` | +| srcs | Additional source files to include in generated Prost source code. | List of labels | optional | `[]` | +| prost_opts | Additional options to add to Prost. | List of strings | optional | `[]` | +| tonic_opts | Additional options to add to Tonic. | List of strings | optional | `[]` | + +