@ -118,13 +118,12 @@ void SingularString::InMsgImpl(Context& ctx,
{ " setter_thunk " , setter_thunk } } ,
{ " setter_thunk " , setter_thunk } } ,
R " rs(
R " rs(
pub fn $ field $ _mut ( & mut self ) - > $ pb $ : : Mut < ' _ , $ proxied_type $ > {
pub fn $ field $ _mut ( & mut self ) - > $ pb $ : : Mut < ' _ , $ proxied_type $ > {
static VTABLE : $ pbi $ : : BytesMutVTable = unsafe {
static VTABLE : $ pbi $ : : BytesMutVTable =
$ pbi $ : : BytesMutVTable : : new (
$ pbi $ : : BytesMutVTable : : new (
$ pbi $ : : Private ,
$ pbi $ : : Private ,
$ getter_thunk $ ,
$ getter_thunk $ ,
$ setter_thunk $ ,
$ setter_thunk $ ,
)
) ;
} ;
unsafe {
unsafe {
< $ pb $ : : Mut < $ proxied_type $ > > : : from_inner (
< $ pb $ : : Mut < $ proxied_type $ > > : : from_inner (
$ pbi $ : : Private ,
$ pbi $ : : Private ,
@ -158,19 +157,19 @@ void SingularString::InExternC(Context& ctx,
{ " getter_thunk " , Thunk ( ctx , field , " get " ) } ,
{ " getter_thunk " , Thunk ( ctx , field , " get " ) } ,
{ " setter_thunk " , Thunk ( ctx , field , " set " ) } ,
{ " setter_thunk " , Thunk ( ctx , field , " set " ) } ,
{ " clearer_thunk " , Thunk ( ctx , field , " clear " ) } ,
{ " clearer_thunk " , Thunk ( ctx , field , " clear " ) } ,
{ " hazzer " ,
{ " with_presence_fields_thunks " ,
[ & ] {
[ & ] {
if ( field . has_presence ( ) ) {
if ( field . has_presence ( ) ) {
ctx . Emit ( R " rs(
ctx . Emit ( R " rs(
fn $ hazzer_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) - > bool ;
fn $ hazzer_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) - > bool ;
fn $ clearer_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) ;
) rs " );
) rs " );
}
}
} } } ,
} } } ,
R " rs(
R " rs(
$ hazzer $
$ with_presence_fields_thunks $
fn $ getter_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) - > $ pbi $ : : PtrAndLen ;
fn $ getter_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) - > $ pbi $ : : PtrAndLen ;
fn $ setter_thunk $ ( raw_msg : $ pbi $ : : RawMessage , val : $ pbi $ : : PtrAndLen ) ;
fn $ setter_thunk $ ( raw_msg : $ pbi $ : : RawMessage , val : $ pbi $ : : PtrAndLen ) ;
fn $ clearer_thunk $ ( raw_msg : $ pbi $ : : RawMessage ) ;
) rs " );
) rs " );
}
}
@ -182,7 +181,7 @@ void SingularString::InThunkCc(Context& ctx,
{ " getter_thunk " , Thunk ( ctx , field , " get " ) } ,
{ " getter_thunk " , Thunk ( ctx , field , " get " ) } ,
{ " setter_thunk " , Thunk ( ctx , field , " set " ) } ,
{ " setter_thunk " , Thunk ( ctx , field , " set " ) } ,
{ " clearer_thunk " , Thunk ( ctx , field , " clear " ) } ,
{ " clearer_thunk " , Thunk ( ctx , field , " clear " ) } ,
{ " hazzer " ,
{ " with_presence_fields_thunks " ,
[ & ] {
[ & ] {
if ( field . has_presence ( ) ) {
if ( field . has_presence ( ) ) {
ctx . Emit ( R " cc(
ctx . Emit ( R " cc(
@ -194,7 +193,7 @@ void SingularString::InThunkCc(Context& ctx,
}
}
} } } ,
} } } ,
R " cc(
R " cc(
$ hazzer $ ;
$ with_presence_fields_thunks $ ;
: : google : : protobuf : : rust_internal : : PtrAndLen $ getter_thunk $ ( $ QualifiedMsg $ * msg ) {
: : google : : protobuf : : rust_internal : : PtrAndLen $ getter_thunk $ ( $ QualifiedMsg $ * msg ) {
absl : : string_view val = msg - > $ field $ ( ) ;
absl : : string_view val = msg - > $ field $ ( ) ;
return : : google : : protobuf : : rust_internal : : PtrAndLen ( val . data ( ) , val . size ( ) ) ;
return : : google : : protobuf : : rust_internal : : PtrAndLen ( val . data ( ) , val . size ( ) ) ;