Allocate enough memory for the InputOver2G test.
[google-protobuf.git] / rust / primitive.rs
blobbf5af332a979364e5a77da7c7001feca6f468210
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
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 {
11   ($($t:ty),*) => {
12       $(
13         impl SealedInternal for $t {}
15         impl Proxied for $t {
16             type View<'msg> = $t;
17         }
19         impl<'msg> Proxy<'msg> for $t {
20         }
22         impl AsView for $t {
23             type Proxied = $t;
25             fn as_view(&self) -> $t {
26               *self
27           }
28         }
30         impl<'msg> IntoView<'msg> for $t {
31             fn into_view<'shorter>(self) -> $t
32             where
33                 'msg: 'shorter {
34               self
35           }
36         }
38         impl<'msg> ViewProxy<'msg> for $t {}
40         // ProxiedInRepeated is implemented in {cpp,upb}.rs
41       )*
42   }
45 impl_singular_primitives!(bool, f32, f64, i32, i64, u32, u64);