Skip to content

Apache DataFusion SQL Query Engine

refactor: mark the ExecutionPlan proto dispatch traits as non-public API (#24001)

Adrian Garcia Badaracco541caab85a26
diff --git a/datafusion/physical-plan/src/proto.rs b/datafusion/physical-plan/src/proto.rs
index 2c6636a392..f84cd67d46 100644
--- a/datafusion/physical-plan/src/proto.rs
+++ b/datafusion/physical-plan/src/proto.rs
@@ -33,7 +33,8 @@
//! * [`ExecutionPlanEncode`] / [`ExecutionPlanDecode`] — internal dispatch
//! traits, *defined* here but *implemented* in `datafusion-proto`, that the
//! context types delegate to. This is the dependency inversion that keeps the
-//! proto types flowing in one direction only.
+//! proto types flowing in one direction only. They are `#[doc(hidden)]`: not
+//! public API, `pub` only because their implementors live in another crate.
//!
//! `datafusion-physical-plan` depends on the pure prost types in
//! `datafusion-proto-models` (feature `proto`), never on `datafusion-proto`.
@@ -73,6 +74,11 @@ use crate::ExecutionPlan;
///
/// Implemented by `datafusion-proto`. Plan authors never name this trait; they
/// call methods on [`ExecutionPlanEncodeCtx`] instead.
+///
+/// **Not public API.** `pub` only because the implementors live in another
+/// crate; `#[doc(hidden)]` records that, so encoding primitives can be added
+/// here as the serialization hooks grow without breaking downstream code.
+#[doc(hidden)]
pub trait ExecutionPlanEncode {
/// Serialize a child execution plan (recursing through the central
/// serializer, so the child's own `try_to_proto` hook is honored).
@@ -98,6 +104,11 @@ pub trait ExecutionPlanEncode {
///
/// Implemented by `datafusion-proto`. Plan authors never name this trait; they
/// call methods on [`ExecutionPlanDecodeCtx`] instead.
+///
+/// **Not public API.** `pub` only because the implementors live in another
+/// crate; `#[doc(hidden)]` records that, so decoding primitives can be added
+/// here as the serialization hooks grow without breaking downstream code.
+#[doc(hidden)]
pub trait ExecutionPlanDecode {
/// Deserialize a child execution plan (recursing through the central
/// deserializer, so the child's own `try_from_proto` is honored).