Struct volo_thrift::ThriftMessage
source · pub struct ThriftMessage<M> {
pub data: Result<M, ApplicationException>,
pub meta: MessageMeta,
}
Fields§
§data: Result<M, ApplicationException>
§meta: MessageMeta
Implementations§
source§impl<M> ThriftMessage<M>
impl<M> ThriftMessage<M>
pub fn mk_client_msg(cx: &ClientContext, msg: M) -> Self
sourcepub fn mk_server_resp(
cx: &ServerContext,
msg: Result<M, ApplicationException>
) -> Self
pub fn mk_server_resp( cx: &ServerContext, msg: Result<M, ApplicationException> ) -> Self
Server response message can only be an Ok(msg) or Err(ApplicationException).
Trait Implementations§
source§impl<M: Debug> Debug for ThriftMessage<M>
impl<M: Debug> Debug for ThriftMessage<M>
source§impl<Req, Resp, MkT, MkC> Service<ClientContext, ThriftMessage<Req>> for Client<Resp, MkT, MkC>where
Req: Send + 'static + EntryMessage,
Resp: EntryMessage + Sync,
MkT: MakeTransport,
MkC: MakeCodec<MkT::ReadHalf, MkT::WriteHalf> + Sync,
impl<Req, Resp, MkT, MkC> Service<ClientContext, ThriftMessage<Req>> for Client<Resp, MkT, MkC>where
Req: Send + 'static + EntryMessage,
Resp: EntryMessage + Sync,
MkT: MakeTransport,
MkC: MakeCodec<MkT::ReadHalf, MkT::WriteHalf> + Sync,
§type Response = Option<ThriftMessage<Resp>>
type Response = Option<ThriftMessage<Resp>>
Responses given by the service.
§type Error = ClientError
type Error = ClientError
Errors produced by the service.
source§async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
req: ThriftMessage<Req>
) -> Result<Self::Response, Self::Error>
async fn call<'s, 'cx>( &'s self, cx: &'cx mut ClientContext, req: ThriftMessage<Req> ) -> Result<Self::Response, Self::Error>
Process the request and return the response asynchronously.
Auto Trait Implementations§
impl<M> !Freeze for ThriftMessage<M>
impl<M> RefUnwindSafe for ThriftMessage<M>where
M: RefUnwindSafe,
impl<M> Send for ThriftMessage<M>where
M: Send,
impl<M> Sync for ThriftMessage<M>where
M: Sync,
impl<M> Unpin for ThriftMessage<M>where
M: Unpin,
impl<M> UnwindSafe for ThriftMessage<M>where
M: UnwindSafe,
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