|
|
|
@ -7,10 +7,10 @@ |
|
|
|
|
|
|
|
|
|
//! UPB FFI wrapper code for use by Rust Protobuf.
|
|
|
|
|
|
|
|
|
|
use crate::ProtoStr; |
|
|
|
|
use crate::__internal::{Private, PtrAndLen, RawArena, RawMap, RawMessage, RawRepeatedField}; |
|
|
|
|
use crate::{ |
|
|
|
|
Mut, Proxied, ProxiedInRepeated, Repeated, RepeatedMut, RepeatedView, View, ViewProxy, |
|
|
|
|
Mut, ProtoStr, Proxied, ProxiedInRepeated, Repeated, RepeatedMut, RepeatedView, SettableValue, |
|
|
|
|
View, ViewProxy, |
|
|
|
|
}; |
|
|
|
|
use core::fmt::Debug; |
|
|
|
|
use paste::paste; |
|
|
|
@ -217,6 +217,15 @@ impl fmt::Debug for SerializedData { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl SettableValue<[u8]> for SerializedData { |
|
|
|
|
fn set_on<'msg>(self, _private: Private, mut mutator: Mut<'msg, [u8]>) |
|
|
|
|
where |
|
|
|
|
[u8]: 'msg, |
|
|
|
|
{ |
|
|
|
|
mutator.set(self.as_ref()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: Investigate replacing this with direct access to UPB bits.
|
|
|
|
|
pub type BytesPresentMutData<'msg> = crate::vtable::RawVTableOptionalMutatorData<'msg, [u8]>; |
|
|
|
|
pub type BytesAbsentMutData<'msg> = crate::vtable::RawVTableOptionalMutatorData<'msg, [u8]>; |
|
|
|
|