pub struct Request {
pub message: Message,
/* private fields */
}
Available on crate feature
service
only.Fields§
§message: Message
Implementations§
Source§impl Request
impl Request
Sourcepub async fn respond(
&self,
response: Result<Bytes, Error>,
) -> Result<(), PublishError>
pub async fn respond( &self, response: Result<Bytes, Error>, ) -> Result<(), PublishError>
Sends response for the request.
§Examples
use async_nats::service::ServiceExt;
use futures::StreamExt;
let mut endpoint = service.endpoint("endpoint").await?;
let request = endpoint.next().await.unwrap();
request.respond(Ok("hello".into())).await?;
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl !UnwindSafe for Request
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