Struct protobuf::reflect::MessageRef[][src]

pub struct MessageRef<'a> { /* fields omitted */ }
Expand description

Wrapper around either Message reference or a container for an empty dynamic message.

Implementations

Wrap a message.

Default (empty) instance of given message type.

Methods from Deref<Target = dyn MessageDyn>

Check if all required fields of this object are initialized.

Write the message to the writer.

Write the message to bytes vec.

Write the message to the stream.

Results in error if message is not fully initialized.

Write the message to the vec, prepend the message with message length encoded as varint.

Write the message to bytes vec.

Note: You can use Message::parse_from_bytes to do the reverse.

Write the message to the stream prepending the message with message length encoded as varint.

Write the message to the writer, prepend the message with message length encoded as varint.

Write the message to the bytes vec, prepend the message with message length encoded as varint.

Downcast &dyn Message to specific message type.

let m: &dyn MessageDyn = message;
let m: &MyMessage = MessageDyn::downcast_ref(m).unwrap();

Clone from a dyn Message reference.

Reflectively compare the messages.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Performs the conversion.

Performs the conversion.

Perform the equality comparison.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.