display trait is added

This commit is contained in:
병준 박 2022-08-03 06:19:47 +00:00
parent 8b28a1b19c
commit e5f4b3c8c2

View File

@ -1,9 +1,20 @@
use std::fmt;
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Error {
#[prost(int32, tag="1")]
pub code: i32,
#[prost(string, optional, tag="2")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes="vec", optional, tag="3")]
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, optional, tag = "2")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "vec", optional, tag = "3")]
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Error code: {}, message: {:?}, data: {:?}",
self.code, self.message, self.data
) // user-facing output
}
}