pub struct RpcResponseHeaderProto {
pub call_id: u32,
pub status: i32,
pub server_ipc_version_num: Option<u32>,
pub exception_class_name: Option<String>,
pub error_msg: Option<String>,
pub error_detail: Option<i32>,
pub client_id: Option<Vec<u8>>,
pub retry_count: Option<i32>,
pub state_id: Option<i64>,
pub router_federated_state: Option<Vec<u8>>,
}
Expand description
Rpc Response Header +——————————————————————+ | Rpc total response length in bytes (4 bytes int) | | (sum of next two parts) | +——————————————————————+ | RpcResponseHeaderProto - serialized delimited ie has len | +——————————————————————+ | if request is successful: | | - RpcResponse - The actual rpc response bytes follow | | the response header | | This response is serialized based on RpcKindProto | | if request fails : | | The rpc response header contains the necessary info | +——————————————————————+
Note that rpc response header is also used when connection setup fails. Ie the response looks like a rpc response with a fake callId.
RpcStastus - success or failure The reponseHeader’s errDetail, exceptionClassName and errMsg contains further details on the error
Fields§
§call_id: u32
callId used in Request
status: i32
§server_ipc_version_num: Option<u32>
Sent if success or fail
exception_class_name: Option<String>
if request fails
error_msg: Option<String>
if request fails, often contains strack trace
error_detail: Option<i32>
in case of error
client_id: Option<Vec<u8>>
Globally unique client ID
retry_count: Option<i32>
§state_id: Option<i64>
The last written Global State ID
router_federated_state: Option<Vec<u8>>
Alignment context info for use with routers. The client should not interpret these bytes, but only forward them to the router using RpcRequestHeaderProto.routerFederatedState.
Implementations§
Source§impl RpcResponseHeaderProto
impl RpcResponseHeaderProto
Sourcepub fn status(&self) -> RpcStatusProto
pub fn status(&self) -> RpcStatusProto
Returns the enum value of status
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_status(&mut self, value: RpcStatusProto)
pub fn set_status(&mut self, value: RpcStatusProto)
Sets status
to the provided enum value.
Sourcepub fn server_ipc_version_num(&self) -> u32
pub fn server_ipc_version_num(&self) -> u32
Returns the value of server_ipc_version_num
, or the default value if server_ipc_version_num
is unset.
Sourcepub fn exception_class_name(&self) -> &str
pub fn exception_class_name(&self) -> &str
Returns the value of exception_class_name
, or the default value if exception_class_name
is unset.
Sourcepub fn error_msg(&self) -> &str
pub fn error_msg(&self) -> &str
Returns the value of error_msg
, or the default value if error_msg
is unset.
Sourcepub fn error_detail(&self) -> RpcErrorCodeProto
pub fn error_detail(&self) -> RpcErrorCodeProto
Returns the enum value of error_detail
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_error_detail(&mut self, value: RpcErrorCodeProto)
pub fn set_error_detail(&mut self, value: RpcErrorCodeProto)
Sets error_detail
to the provided enum value.
Sourcepub fn client_id(&self) -> &[u8] ⓘ
pub fn client_id(&self) -> &[u8] ⓘ
Returns the value of client_id
, or the default value if client_id
is unset.
Sourcepub fn retry_count(&self) -> i32
pub fn retry_count(&self) -> i32
Returns the value of retry_count
, or the default value if retry_count
is unset.
Sourcepub fn state_id(&self) -> i64
pub fn state_id(&self) -> i64
Returns the value of state_id
, or the default value if state_id
is unset.
Sourcepub fn router_federated_state(&self) -> &[u8] ⓘ
pub fn router_federated_state(&self) -> &[u8] ⓘ
Returns the value of router_federated_state
, or the default value if router_federated_state
is unset.
Trait Implementations§
Source§impl Clone for RpcResponseHeaderProto
impl Clone for RpcResponseHeaderProto
Source§fn clone(&self) -> RpcResponseHeaderProto
fn clone(&self) -> RpcResponseHeaderProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RpcResponseHeaderProto
impl Debug for RpcResponseHeaderProto
Source§impl Default for RpcResponseHeaderProto
impl Default for RpcResponseHeaderProto
Source§impl Message for RpcResponseHeaderProto
impl Message for RpcResponseHeaderProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for RpcResponseHeaderProto
impl PartialEq for RpcResponseHeaderProto
impl StructuralPartialEq for RpcResponseHeaderProto
Auto Trait Implementations§
impl Freeze for RpcResponseHeaderProto
impl RefUnwindSafe for RpcResponseHeaderProto
impl Send for RpcResponseHeaderProto
impl Sync for RpcResponseHeaderProto
impl Unpin for RpcResponseHeaderProto
impl UnwindSafe for RpcResponseHeaderProto
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request