Add an protobuf::__internal::SealedInternal trait The purpose of this trait is that it is declared as a supertrait of the traits that we don't want application code to implement (like "Proxied" and "MessageView"); application code can see those traits but not the supertrait, which enables them to use them but not implement them. PiperOrigin-RevId: 657555025
diff --git a/rust/repeated.rs b/rust/repeated.rs index 1a43dce..1fd5e0e 100644 --- a/rust/repeated.rs +++ b/rust/repeated.rs
@@ -17,7 +17,7 @@ use crate::{ AsMut, AsView, IntoMut, IntoProxied, IntoView, Mut, MutProxied, MutProxy, Proxied, Proxy, View, ViewProxy, - __internal::Private, + __internal::{Private, SealedInternal}, __runtime::{InnerRepeated, InnerRepeatedMut, RawRepeatedField}, }; @@ -382,6 +382,8 @@ type View<'msg> = RepeatedView<'msg, T> where Repeated<T>: 'msg; } +impl<T> SealedInternal for Repeated<T> where T: ProxiedInRepeated {} + impl<T> AsView for Repeated<T> where T: ProxiedInRepeated, @@ -411,6 +413,8 @@ } } +impl<'msg, T> SealedInternal for RepeatedView<'msg, T> where T: ProxiedInRepeated + 'msg {} + impl<'msg, T> Proxy<'msg> for RepeatedView<'msg, T> where T: ProxiedInRepeated + 'msg {} impl<'msg, T> AsView for RepeatedView<'msg, T> @@ -440,6 +444,8 @@ impl<'msg, T> ViewProxy<'msg> for RepeatedView<'msg, T> where T: ProxiedInRepeated + 'msg {} +impl<'msg, T> SealedInternal for RepeatedMut<'msg, T> where T: ProxiedInRepeated + 'msg {} + impl<'msg, T> Proxy<'msg> for RepeatedMut<'msg, T> where T: ProxiedInRepeated + 'msg {} impl<'msg, T> AsView for RepeatedMut<'msg, T>