1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 use crate::__internal::SealedInternal;
8 use crate::{AsView, IntoView, Proxied, Proxy, ViewProxy};
10 macro_rules! impl_singular_primitives {
13 impl SealedInternal for $t {}
19 impl<'msg> Proxy<'msg> for $t {
25 fn as_view(&self) -> $t {
30 impl<'msg> IntoView<'msg> for $t {
31 fn into_view<'shorter>(self) -> $t
38 impl<'msg> ViewProxy<'msg> for $t {}
40 // ProxiedInRepeated is implemented in {cpp,upb}.rs
45 impl_singular_primitives!(bool, f32, f64, i32, i64, u32, u64);