pub struct OnIdentify(pub NsqdConfig);
Expand description
Sent by Connection after identify succeeds
§Examples
use actix::prelude::*;
use nsq_client::{Connection, Subscribe, OnIdentify};
struct Consumer(pub Addr<Connection>);
impl Actor for Consumer {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
self.subscribe::<OnIdentify>(ctx, self.0.clone());
}
}
impl Handler<OnIdentify> for Consumer {
type Result = ();
fn handle(&mut self, msg: OnIdentify, ctx: &mut Self::Conetxt) {
println!("identified: {:?}", msg.0);
}
}
Tuple Fields§
§0: NsqdConfig
Trait Implementations§
Source§impl Clone for OnIdentify
impl Clone for OnIdentify
Source§fn clone(&self) -> OnIdentify
fn clone(&self) -> OnIdentify
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for OnIdentify
impl RefUnwindSafe for OnIdentify
impl Send for OnIdentify
impl Sync for OnIdentify
impl Unpin for OnIdentify
impl UnwindSafe for OnIdentify
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