pub struct Responder { /* private fields */ }Expand description
Reply builder passed to producer handlers in [Producer::serve].
A Responder is a single-use object: call exactly one of [respond],
[respond_bytes], or [nack] to send a reply. Dropping without calling
a reply method silently discards the Interest.
§Example
use ndn_packet::encode::DataBuilder;
producer.serve(|interest, responder| async move {
let data = DataBuilder::new((*interest.name).clone(), b"hello").build();
responder.respond_bytes(data).await.ok();
}).awaitImplementations§
Source§impl Responder
impl Responder
Auto Trait Implementations§
impl !Freeze for Responder
impl !RefUnwindSafe for Responder
impl Send for Responder
impl Sync for Responder
impl Unpin for Responder
impl !UnwindSafe for Responder
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