use_prelude!();
use std::sync::{Arc, Weak};
use super::{v2::V2Presence, v3::Peer};
pub struct OnConnect {
_ctx: Arc<OnConnectCtx>,
}
pub(crate) type WeakOnConnect = Weak<OnConnectCtx>;
impl OnConnect {
pub(crate) fn new(_ctx: Arc<OnConnectCtx>) -> Self {
Self { _ctx }
}
}
impl Observer for OnConnect {}
pub(crate) struct OnConnectCtx {
pub(crate) on_presence: Box<dyn Fn(&Peer) + Send + Sync + 'static>,
}
impl OnConnectCtx {
pub(crate) fn new(on_presence: Box<dyn Fn(&Peer) + Send + Sync + 'static>) -> Self {
Self { on_presence }
}
}