diff --git a/conformance/conformance_rust.rs b/conformance/conformance_rust.rs index 5b794c4a3c..820d67cff7 100644 --- a/conformance/conformance_rust.rs +++ b/conformance/conformance_rust.rs @@ -8,7 +8,7 @@ use conformance_rust_proto::{ConformanceRequest, ConformanceResponse, WireFormat use protobuf::prelude::*; use protobuf::Optional::{Set, Unset}; -use protobuf::ParseError; +use protobuf::{Message, ParseError}; use std::io::{self, ErrorKind, Read, Write}; use test_messages_edition2023_rust_proto::TestAllTypesEdition2023; diff --git a/rust/prelude.rs b/rust/prelude.rs index e06a73d252..cd98cdedb8 100644 --- a/rust/prelude.rs +++ b/rust/prelude.rs @@ -6,11 +6,18 @@ // https://developers.google.com/open-source/licenses/bsd //! Prelude for the Protobuf Rust API. -//! This module contains only non-struct items that are needed for extremely -//! common usages of the generated types from application code. Any struct -//! or less common items should be imported normally. +//! +//! This module contains only the proto! macro and traits which define very +//! common fns that on messages (fns that would be methods on a base class in +//! other languages). +//! +//! All traits here have `Proto` prefixed on them, as the intent of this prelude +//! is to make the methods callable on message instances: if the traits are +//! named for generic reasons, they should be explicitly imported from the +//! `protobuf::` crate instead. pub use crate::{ - proto, AsMut, AsView, Clear, ClearAndParse, IntoMut, IntoView, MergeFrom, Message, MessageMut, - MessageView, Parse, Serialize, + proto, AsMut as ProtoAsMut, AsView as ProtoAsView, Clear as ProtoClear, + ClearAndParse as ProtoClearAndParse, IntoMut as ProtoIntoMut, IntoView as ProtoIntoView, + MergeFrom as ProtoMergeFrom, Parse as ProtoParse, Serialize as ProtoSerialize, };