diff --git a/rust/protobuf.rs b/rust/protobuf.rs index ac4c4e0b2c..beb30ad5f4 100644 --- a/rust/protobuf.rs +++ b/rust/protobuf.rs @@ -41,6 +41,4 @@ use protobuf_cpp as kernel; #[cfg(upb_kernel)] use protobuf_upb as kernel; -pub use kernel::{ - BytesMut, Mut, MutProxy, ParseError, Proxied, ProxiedWithPresence, View, ViewProxy, -}; +pub use kernel::__public::*; diff --git a/rust/shared.rs b/rust/shared.rs index 0e8b7d2301..dfee341a5f 100644 --- a/rust/shared.rs +++ b/rust/shared.rs @@ -36,9 +36,17 @@ use std::fmt; -pub use optional::{AbsentField, FieldEntry, Optional, PresentField}; -pub use proxied::{Mut, MutProxy, Proxied, ProxiedWithPresence, SettableValue, View, ViewProxy}; -pub use string::{BytesMut, ProtoStr}; +/// Everything in `__public` is re-exported in `protobuf.rs`. +/// These are the items protobuf users can access directly. +#[doc(hidden)] +pub mod __public { + pub use crate::optional::{AbsentField, FieldEntry, Optional, PresentField}; + pub use crate::proxied::{ + Mut, MutProxy, Proxied, ProxiedWithPresence, SettableValue, View, ViewProxy, + }; + pub use crate::string::{BytesMut, ProtoStr}; +} +pub use __public::*; /// Everything in `__internal` is allowed to change without it being considered /// a breaking change for the protobuf library. Nothing in here should be