pub struct Fin(pub String);
Expand description
Send FIN command to nsqd
Args:
- id - id of the message
§Examples
use actix::prelude::*;
use nsq_client::{Connection, Subscribe, Msg, Fin};
struct Consumer(pub Addr<Connection>);
impl Actor for Consumer {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
self.subscribe::<Msg>(ctx, self.0.clone());
}
}
impl Handler<Msg> for Consumer {
type Result = ();
fn handle(&mut self, msg: Msg, ctx: &mut Self::Conetxt) {
self.0.do_send(Fin(msg.id));
}
}
Tuple Fields§
§0: String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fin
impl RefUnwindSafe for Fin
impl Send for Fin
impl Sync for Fin
impl Unpin for Fin
impl UnwindSafe for Fin
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