pub fn protobuf<T>(value: &T) -> Option<Any>
where
    T: prost::Message,
{
    let mut buf = vec![];

    value.encode(&mut buf).ok()?;

    Some(Any {
        value: buf,
        type_url: format!("{}/{}", RUST_LANG_URL, type_name::<T>()),
    })
}
/// Serialize the given data structure as a Protobuf message.
Serialize the given data structure as a Protobuf message.
Serialize the given data structure as a Protobuf message .
pub fn protobuf<T>(value: &T) -> Option<Any>
where
    T: prost::Message,
{
    let mut buf = vec![];
    value.encode(&mut buf).ok()?;
    Some(Any {
        value: buf,
        type_url: format!("{}/{}", RUST_LANG_URL, type_name::<T>()),
    })
}
pub fn protobuf < T > ( value : & T ) -> Option < Any > where T : prost :: Message , { let mut buf = vec ! [ ] ; value . encode ( & mut buf ) . ok ( ) ? ; Some ( Any { value : buf , type_url : format ! ( " " RUST_LANG_URL type_name T ( ) ) , } ) }
Serialize the given data structure as a Protobuf message.
Serialize the given data structure as a Protobuf message .
value
&T
value
&T