[−][src]Trait gf::support::protobuf::Protobuf
An object that can be serialized and deserialized as a Protocol buffers message.
An object can implement this trait multiple times, for different major message versions.
Required methods
fn from_protobuf(src: M) -> Result<Self, ProtobufError>
Convert from the message type.
fn to_protobuf(&self) -> M
Convert to the message type.
Provided methods
fn from_protobuf_opt(src: Option<M>) -> Result<Option<Self>, ProtobufError>
Convert from an optional source.
fn from_protobuf_opt_req(src: Option<M>) -> Result<Self, ProtobufError>
Convert from a required source that is expressed as an Option
.
fn from_protobuf_vec(src: Vec<M>) -> Result<Vec<Self>, ProtobufError>
Convert from a vector.
fn from_protobuf_bytes(bytes: &[u8]) -> Result<Self, ProtobufError>
Deserialize from a slice of bytes using the message type.
fn to_protobuf_bytes(&self) -> Vec<u8>
Serialize to a vector of bytes using the message type.