pub struct Any { /* private fields */ }Expand description
A message of any type, with the type it is (google.protobuf.Any), in
its JSON form: the message’s fields next to @type.
Implementations§
Source§impl Any
impl Any
Sourcepub fn new(type_url: impl Into<String>, fields: Map<String, Value>) -> Self
pub fn new(type_url: impl Into<String>, fields: Map<String, Value>) -> Self
An Any of type type_url, such as
type.googleapis.com/google.rpc.ErrorInfo, holding fields.
Sourcepub fn type_name(&self) -> &str
pub fn type_name(&self) -> &str
The type’s full name, such as google.rpc.ErrorInfo: the type URL
after its last /.
Sourcepub fn decode<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn decode<T: DeserializeOwned>(&self) -> Result<T, Error>
The message, read as T. A well-known type with a JSON form of its
own, such as google.protobuf.Empty, is read from value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Any
impl<'de> Deserialize<'de> for Any
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Any
Auto Trait Implementations§
impl Freeze for Any
impl RefUnwindSafe for Any
impl Send for Any
impl Sync for Any
impl Unpin for Any
impl UnsafeUnpin for Any
impl UnwindSafe for Any
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