Restructure the ViewProxy versus MutProxy trait setup.
Rather than two traits (MutProxy subtrait of ViewProxy), instead have three traits (MutProxy subtrait of Proxy, and ViewProxy subtrait of Proxy).
This makes things more consistent, including that (MutProxied subtraits Proxied) is now more parallel to (MutProxy subtraits Proxy).
ViewProxy is largely a marker trait here but leaves a spot for methods that should be on ViewProxies but not MutProxies if those do show up later.
PiperOrigin-RevId: 653661953
diff --git a/rust/repeated.rs b/rust/repeated.rs
index 99c935b..692a249 100644
--- a/rust/repeated.rs
+++ b/rust/repeated.rs
@@ -15,7 +15,7 @@
use std::marker::PhantomData;
use crate::{
- IntoProxied, Mut, MutProxied, MutProxy, Proxied, View, ViewProxy,
+ IntoProxied, Mut, MutProxied, MutProxy, Proxied, Proxy, View, ViewProxy,
__internal::Private,
__runtime::{InnerRepeated, InnerRepeatedMut, RawRepeatedField},
};
@@ -397,7 +397,7 @@
type Mut<'msg> = RepeatedMut<'msg, T> where Repeated<T>: 'msg;
}
-impl<'msg, T> ViewProxy<'msg> for RepeatedView<'msg, T>
+impl<'msg, T> Proxy<'msg> for RepeatedView<'msg, T>
where
T: ProxiedInRepeated + 'msg,
{
@@ -417,7 +417,9 @@
}
}
-impl<'msg, T> ViewProxy<'msg> for RepeatedMut<'msg, T>
+impl<'msg, T> ViewProxy<'msg> for RepeatedView<'msg, T> where T: ProxiedInRepeated + 'msg {}
+
+impl<'msg, T> Proxy<'msg> for RepeatedMut<'msg, T>
where
T: ProxiedInRepeated + 'msg,
{