Struct mrsc::Request
[−]
[src]
pub struct Request<T, R> { /* fields omitted */ }
The request as seen by the server thread
Methods
impl<T, R> Request<T, R>
[src]
fn get(&self) -> &T
[src]
Returns a reference to the request payload.
fn take(self) -> (EmptyRequest<R>, T)
[src]
Returns the payload and an EmptyRequest, consumes the Request.
fn reply(self, response: R) -> Result<(), SendError<R>>
[src]
Reply to the request with a response. This consumes the request.
Examples
use mrsc; let server: mrsc::Server<u32, String> = mrsc::Server::new(); let channel = server.pop(); // send request let response = channel.req(123).unwrap(); // answer request let req = server.recv().unwrap(); req.reply("hello world".to_string()).unwrap();