pub struct VmOpMerge {
pub skip_submessages: Option<bool>,
pub del_if_src_empty: Option<bool>,
}Expand description
Merges SRC into DST. Both need to point to a message (not a field).
Fields§
§skip_submessages: Option<bool>When true, the merge operation will skip any field that is already resolved as a message node in the destination tree.
This is used to support merging of nested messages. Because ProtoVM does not know the schema, a standard MERGE cannot distinguish between a string and a message on the wire and it would overwrite the entire blob, destroying granular updates.
By setting this to true, a program can be implemented to do a bottom-up, multi-step merge by traversing into and merging the deepest submessages first, then moving up to the parent message and merging it with skip_submessages = true.
del_if_src_empty: Option<bool>When true, the merge operation will remove the dst field if the src field is empty.
This can be used to replicate the removal of a subobject within the producer’s state. E.g. This event on the producer side: mProducerState.mSubobject = nullptr can be represented by this patch: { producer_state { subobject {} }}
Implementations§
Source§impl VmOpMerge
impl VmOpMerge
Sourcepub fn skip_submessages(&self) -> bool
pub fn skip_submessages(&self) -> bool
Returns the value of skip_submessages, or the default value if skip_submessages is unset.
Sourcepub fn del_if_src_empty(&self) -> bool
pub fn del_if_src_empty(&self) -> bool
Returns the value of del_if_src_empty, or the default value if del_if_src_empty is unset.
Trait Implementations§
Source§impl Message for VmOpMerge
impl Message for VmOpMerge
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self.