pub struct OnAuth(pub AuthResp);
Expand description
Sent by Connection if auth be successful
§Examples
use actix::prelude::*;
use nsq_client::{Connection, Subscribe, OnAuth};
struct Consumer(pub Addr<Connection>);
impl Actor for Consumer {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
self.subscribe::<OnAuth>(ctx, self.0.clone());
}
}
impl Handler<OnAuth> for Consumer {
type Result = ();
fn handle(&mut self, msg: OnAuth, ctx: &mut Self::Conetxt) {
println!("authenticated: {:?}", msg.0);
}
}
Tuple Fields§
§0: AuthResp
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OnAuth
impl RefUnwindSafe for OnAuth
impl Send for OnAuth
impl Sync for OnAuth
impl Unpin for OnAuth
impl UnwindSafe for OnAuth
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