|
|
|
@ -497,7 +497,7 @@ void GenerateRs(Context& ctx, const Descriptor& msg) { |
|
|
|
|
|
|
|
|
|
impl<'a> $Msg$Mut<'a> { |
|
|
|
|
#[doc(hidden)] |
|
|
|
|
pub fn new(_private: $pbi$::Private, |
|
|
|
|
pub fn from_parent(_private: $pbi$::Private, |
|
|
|
|
parent: &'a mut $pbr$::MessageInner, |
|
|
|
|
msg: $pbi$::RawMessage) |
|
|
|
|
-> Self { |
|
|
|
@ -506,6 +506,10 @@ void GenerateRs(Context& ctx, const Descriptor& msg) { |
|
|
|
|
$pbi$::Private, parent, msg) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#[doc(hidden)] |
|
|
|
|
pub fn new(_private: $pbi$::Private, msg: &'a mut $pbr$::MessageInner) -> Self { |
|
|
|
|
Self{ inner: $pbr$::MutatorMessageRef::new(_private, msg) } |
|
|
|
|
} |
|
|
|
|
$accessor_fns_for_muts$ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -544,6 +548,14 @@ void GenerateRs(Context& ctx, const Descriptor& msg) { |
|
|
|
|
$Msg::deserialize$ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn as_view(&self) -> $Msg$View { |
|
|
|
|
$Msg$View::new($pbi$::Private, self.inner.msg) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn as_mut(&mut self) -> $Msg$Mut { |
|
|
|
|
$Msg$Mut::new($pbi$::Private, &mut self.inner) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$accessor_fns$ |
|
|
|
|
|
|
|
|
|
$oneof_accessor_fns$ |
|
|
|
|