pub struct MessageValue {
pub msg_ref: MessageRef,
pub fields: Vec<FieldValue>,
pub garbage: Option<Bytes>,
}
Expand description
Message value.
Fields§
§msg_ref: MessageRef
Reference to the message type.
fields: Vec<FieldValue>
Mesage field values.
garbage: Option<Bytes>
Garbage data at the end of the message.
As opposed to an UnknownValue::Invalid
, the garbage data did not have a valid field
number and for that reason cannot be placed into the fields
vector.
Implementations§
Source§impl MessageValue
impl MessageValue
Sourcepub fn encode(&self, ctx: &Context) -> BytesMut
pub fn encode(&self, ctx: &Context) -> BytesMut
Encodes a message value into protobuf wire format.
Will panic if the message defined by the MessageRef
does not exist in this context.
Such panic means the MessageRef
came from a different context. The panic is not
guaranteed, as a message with an equal MessageRef
may exist in multiple contexts.
Trait Implementations§
Source§impl Clone for MessageValue
impl Clone for MessageValue
Source§fn clone(&self) -> MessageValue
fn clone(&self) -> MessageValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MessageValue
impl Debug for MessageValue
Source§impl PartialEq for MessageValue
impl PartialEq for MessageValue
impl StructuralPartialEq for MessageValue
Auto Trait Implementations§
impl !Freeze for MessageValue
impl RefUnwindSafe for MessageValue
impl Send for MessageValue
impl Sync for MessageValue
impl Unpin for MessageValue
impl UnwindSafe for MessageValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more