pub struct Message<Body> {
pub header: MessageHeader,
pub body: Body,
}
Expand description
A complete RPC message, including header and body.
Fields§
§header: MessageHeader
The header of the message.
body: Body
The body of the message.
Implementations§
source§impl<Body> Message<Body>
impl<Body> Message<Body>
sourcepub fn new(header: MessageHeader, body: Body) -> Self
pub fn new(header: MessageHeader, body: Body) -> Self
Create a new message with a header and a body.
sourcepub fn request(request_id: u32, service_id: i32, body: Body) -> Self
pub fn request(request_id: u32, service_id: i32, body: Body) -> Self
Create a new request message.
sourcepub fn response(request_id: u32, service_id: i32, body: Body) -> Self
pub fn response(request_id: u32, service_id: i32, body: Body) -> Self
Create a new response message.
sourcepub fn error_response(request_id: u32, message: &str) -> Selfwhere
Body: Body,
pub fn error_response(request_id: u32, message: &str) -> Selfwhere
Body: Body,
Create a new error response message.
sourcepub fn requester_update(request_id: u32, service_id: i32, body: Body) -> Self
pub fn requester_update(request_id: u32, service_id: i32, body: Body) -> Self
Create a new requester update message.
sourcepub fn responder_update(request_id: u32, service_id: i32, body: Body) -> Self
pub fn responder_update(request_id: u32, service_id: i32, body: Body) -> Self
Create a new responder update message.
Trait Implementations§
Auto Trait Implementations§
impl<Body> RefUnwindSafe for Message<Body>where
Body: RefUnwindSafe,
impl<Body> Send for Message<Body>where
Body: Send,
impl<Body> Sync for Message<Body>where
Body: Sync,
impl<Body> Unpin for Message<Body>where
Body: Unpin,
impl<Body> UnwindSafe for Message<Body>where
Body: 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