@ -261,17 +261,17 @@ impl From<RustStringRawParts> for String {
}
extern "C" {
fn utf8_debug_string ( msg : RawMessage ) -> RustStringRawParts ;
fn utf8_debug_string_lite ( msg : RawMessage ) -> RustStringRawParts ;
fn rust_proto_ utf8_debug_string( msg : RawMessage ) -> RustStringRawParts ;
fn rust_proto_ utf8_debug_string_lite( msg : RawMessage ) -> RustStringRawParts ;
}
pub fn debug_string ( _private : Private , msg : RawMessage , f : & mut fmt ::Formatter < ' _ > ) -> fmt ::Result {
// SAFETY:
// - `msg` is a valid protobuf message.
#[ cfg(not(lite_runtime)) ]
let dbg_str : String = unsafe { utf8_debug_string ( msg ) } . into ( ) ;
let dbg_str : String = unsafe { rust_proto_ utf8_debug_string( msg ) } . into ( ) ;
#[ cfg(lite_runtime) ]
let dbg_str : String = unsafe { utf8_debug_string_lite ( msg ) } . into ( ) ;
let dbg_str : String = unsafe { rust_proto_ utf8_debug_string_lite( msg ) } . into ( ) ;
write! ( f , "{dbg_str}" )
}
@ -485,15 +485,15 @@ macro_rules! impl_repeated_primitives {
paste ! {
impl_repeated_primitives ! ( @ impl $(
$t = > [
[ < __pb_rust _RepeatedField_ $t _new > ] ,
[ < __pb_rust _RepeatedField_ $t _free > ] ,
[ < __pb_rust _RepeatedField_ $t _add > ] ,
[ < __pb_rust _RepeatedField_ $t _size > ] ,
[ < __pb_rust _RepeatedField_ $t _get > ] ,
[ < __pb_rust _RepeatedField_ $t _set > ] ,
[ < __pb_rust _RepeatedField_ $t _clear > ] ,
[ < __pb_rust _RepeatedField_ $t _copy_from > ] ,
[ < __pb_rust _RepeatedField_ $t _reserve > ] ,
[ < rust_proto _RepeatedField_ $t _new > ] ,
[ < rust_proto _RepeatedField_ $t _free > ] ,
[ < rust_proto _RepeatedField_ $t _add > ] ,
[ < rust_proto _RepeatedField_ $t _size > ] ,
[ < rust_proto _RepeatedField_ $t _get > ] ,
[ < rust_proto _RepeatedField_ $t _set > ] ,
[ < rust_proto _RepeatedField_ $t _clear > ] ,
[ < rust_proto _RepeatedField_ $t _copy_from > ] ,
[ < rust_proto _RepeatedField_ $t _reserve > ] ,
] ,
) * ) ;
}
@ -644,7 +644,7 @@ impl UntypedMapIterator {
// - Standard layout.
// - The size and alignment of the Rust type above.
// - With the `node_` field first.
unsafe { __ rust_proto_thunk_ _UntypedMapIterator_increment( self ) }
unsafe { rust_proto_thunk_UntypedMapIterator_increment ( self ) }
// SAFETY:
// - The `get` function always writes valid values to `ffi_key` and `ffi_value`
@ -656,22 +656,22 @@ impl UntypedMapIterator {
}
extern "C" {
fn __ rust_proto_thunk_ _UntypedMapIterator_increment( iter : & mut UntypedMapIterator ) ;
fn rust_proto_thunk_UntypedMapIterator_increment ( iter : & mut UntypedMapIterator ) ;
}
macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
( $key_t :ty , $ffi_key_t :ty , $to_ffi_key :expr , $from_ffi_key :expr , for $( $t :ty , $ffi_t :ty , $to_ffi_value :expr , $from_ffi_value :expr ; ) * ) = > {
paste ! { $(
extern "C" {
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _new > ] ( ) -> RawMap ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _free > ] ( m : RawMap ) ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _clear > ] ( m : RawMap ) ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _size > ] ( m : RawMap ) -> usize ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _insert > ] ( m : RawMap , key : $ffi_key_t , value : $ffi_t ) -> bool ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _get > ] ( m : RawMap , key : $ffi_key_t , value : * mut $ffi_t ) -> bool ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _iter > ] ( m : RawMap ) -> UntypedMapIterator ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _iter_get > ] ( iter : & mut UntypedMapIterator , key : * mut $ffi_key_t , value : * mut $ffi_t ) ;
fn [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _remove > ] ( m : RawMap , key : $ffi_key_t , value : * mut $ffi_t ) -> bool ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _new > ] ( ) -> RawMap ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _free > ] ( m : RawMap ) ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _clear > ] ( m : RawMap ) ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _size > ] ( m : RawMap ) -> usize ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _insert > ] ( m : RawMap , key : $ffi_key_t , value : $ffi_t ) -> bool ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _get > ] ( m : RawMap , key : $ffi_key_t , value : * mut $ffi_t ) -> bool ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _iter > ] ( m : RawMap ) -> UntypedMapIterator ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _iter_get > ] ( iter : & mut UntypedMapIterator , key : * mut $ffi_key_t , value : * mut $ffi_t ) ;
fn [ < rust_proto_thunk_Map_ $key_t _ $t _remove > ] ( m : RawMap , key : $ffi_key_t , value : * mut $ffi_t ) -> bool ;
}
impl ProxiedInMapValue < $key_t > for $t {
@ -680,7 +680,7 @@ macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
Map ::from_inner (
Private ,
InnerMap {
raw : [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _new > ] ( ) ,
raw : [ < rust_proto_thunk_Map_ $key_t _ $t _new > ] ( ) ,
}
)
}
@ -690,28 +690,28 @@ macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
// SAFETY:
// - `map.inner.raw` is a live `RawMap`
// - This function is only called once for `map` in `Drop`.
unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _free > ] ( map . as_mut ( ) . as_raw ( Private ) ) ; }
unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _free > ] ( map . as_mut ( ) . as_raw ( Private ) ) ; }
}
fn map_clear ( mut map : Mut < ' _ , Map < $key_t , Self > > ) {
unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _clear > ] ( map . as_raw ( Private ) ) ; }
unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _clear > ] ( map . as_raw ( Private ) ) ; }
}
fn map_len ( map : View < ' _ , Map < $key_t , Self > > ) -> usize {
unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _size > ] ( map . as_raw ( Private ) ) }
unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _size > ] ( map . as_raw ( Private ) ) }
}
fn map_insert ( mut map : Mut < ' _ , Map < $key_t , Self > > , key : View < ' _ , $key_t > , value : View < ' _ , Self > ) -> bool {
let ffi_key = $to_ffi_key ( key ) ;
let ffi_value = $to_ffi_value ( value ) ;
unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _insert > ] ( map . as_raw ( Private ) , ffi_key , ffi_value ) }
unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _insert > ] ( map . as_raw ( Private ) , ffi_key , ffi_value ) }
}
fn map_get < ' a > ( map : View < ' a , Map < $key_t , Self > > , key : View < ' _ , $key_t > ) -> Option < View < ' a , Self > > {
let ffi_key = $to_ffi_key ( key ) ;
let mut ffi_value = MaybeUninit ::uninit ( ) ;
let found = unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _get > ] ( map . as_raw ( Private ) , ffi_key , ffi_value . as_mut_ptr ( ) ) } ;
let found = unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _get > ] ( map . as_raw ( Private ) , ffi_key , ffi_value . as_mut_ptr ( ) ) } ;
if ! found {
return None ;
@ -723,7 +723,7 @@ macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
fn map_remove ( mut map : Mut < ' _ , Map < $key_t , Self > > , key : View < ' _ , $key_t > ) -> bool {
let ffi_key = $to_ffi_key ( key ) ;
let mut ffi_value = MaybeUninit ::uninit ( ) ;
unsafe { [ < __ rust_proto_thunk_ _Map_ $key_t _ $t _remove > ] ( map . as_raw ( Private ) , ffi_key , ffi_value . as_mut_ptr ( ) ) }
unsafe { [ < rust_proto_thunk_Map_ $key_t _ $t _remove > ] ( map . as_raw ( Private ) , ffi_key , ffi_value . as_mut_ptr ( ) ) }
}
fn map_iter ( map : View < ' _ , Map < $key_t , Self > > ) -> MapIter < ' _ , $key_t , Self > {
@ -735,7 +735,7 @@ macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
unsafe {
MapIter ::from_raw (
Private ,
[ < __ rust_proto_thunk_ _Map_ $key_t _ $t _iter > ] ( map . as_raw ( Private ) )
[ < rust_proto_thunk_Map_ $key_t _ $t _iter > ] ( map . as_raw ( Private ) )
)
}
}
@ -750,7 +750,7 @@ macro_rules! impl_ProxiedInMapValue_for_non_generated_value_types {
unsafe {
iter . as_raw_mut ( Private ) . next_unchecked ::< $key_t , Self , _ , _ > (
Private ,
[ < __ rust_proto_thunk_ _Map_ $key_t _ $t _iter_get > ] ,
[ < rust_proto_thunk_Map_ $key_t _ $t _iter_get > ] ,
$from_ffi_key ,
$from_ffi_value ,
)