Skip to main content

hatchet_proto/
lib.rs

1//! Generated prost/tonic code for the [Hatchet](https://hatchet.run) gRPC API.
2//!
3//! The code under `src/gen/` is generated from the protos in `api-contracts/`
4//! (copied unmodified from the official Hatchet repository) by
5//! `cargo xtask codegen`, and committed, so building this crate never needs
6//! `protoc`.
7//!
8//! # Layout
9//!
10//! Three Hatchet protos (`dispatcher`, `events`, `workflows`) declare no
11//! `package`, and `workflows` refers to `v1` types by relative path. The
12//! [`v1`] module is therefore nested inside [`root`], and re-exported at the
13//! crate root for convenience:
14//!
15//! | gRPC service | Module |
16//! |---|---|
17//! | `/Dispatcher/…`, `/EventsService/…`, `/WorkflowService/…` | [`root`] |
18//! | `/v1.AdminService/…`, `/v1.V1Dispatcher/…` | [`v1`] |
19//!
20//! # Features
21//!
22//! - `server`: also compile the generated tonic server traits, which is
23//!   useful for building a mock engine in tests.
24
25pub use prost;
26pub use prost_types;
27pub use tonic;
28
29/// The Hatchet release whose protos this crate was generated from, as the git
30/// tag of the official repository — for example `"v0.107.0"`.
31///
32/// This is not the version of the engine you are talking to, and not this
33/// crate's own version: it says which `api-contracts/` snapshot the code under
34/// `src/gen/` came from. The exact commit is recorded in `api-contracts/VERSION`
35/// in the repository. For the oldest engine the SDK supports, see
36/// `hatchet_client::MIN_ENGINE_VERSION`.
37pub const HATCHET_VERSION: &str = "v0.107.0";
38
39/// Messages and services from the protos that declare no `package`.
40#[allow(missing_docs, clippy::all, rustdoc::all)]
41pub mod root {
42    include!("gen/_.rs");
43
44    /// Messages and services from the `v1` proto package.
45    pub mod v1 {
46        include!("gen/v1.rs");
47    }
48}
49
50pub use root::v1;