Struct async_nats::service::Request
source · pub struct Request {
pub message: Message,
/* private fields */
}
Available on crate feature
service
only.Expand description
Request returned by Service [Stream][futures::Stream].
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 !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