// the reason we made clientid Arc but topic reference is that topic will be sliced anyways so
// no need to do expensive AtomicUsize increment
the reason we made clientid Arc but topic reference is that topic will be sliced anyways so
no need to do expensive AtomicUsize increment
the reason we made clientid Arc but topic reference is that topic will be sliced anyways so no need to do expensive AtomicUsize increment
async fn topics_add(
        &self,
        clientid: Arc<str>,
        topic: &str,
        qos: QoS,
        flags: SubscriptionFlags,
    ) {
        self.visit(topic, true, |block: &Block, is_hash: bool| {
            Box::pin(async move {
                if is_hash {
                    block
                        .read()
                        .await
                        .insert_into_hash(clientid, qos, flags)
                        .await;
                } else {
                    block
                        .read()
                        .await
                        .insert_into_subs(clientid, qos, flags)
                        .await;
                }
            })
        })
        .await
    }
async fn topics_add ( & self , clientid : Arc < str > , topic : & str , qos : QoS , flags : SubscriptionFlags , ) { self . visit ( topic , true , | block : & Block , is_hash : bool | { Box :: pin ( async move { if is_hash { block . read ( ) . await . insert_into_hash ( clientid , qos , flags ) . await ; } else { block . read ( ) . await . insert_into_subs ( clientid , qos , flags ) . await ; } } ) } ) . await }
the reason we made clientid Arc but topic reference is that topic will be sliced anyways so
no need to do expensive AtomicUsize increment
the reason we made clientid Arc but topic reference is that topic will be sliced anyways so no need to do expensive AtomicUsize increment
&self
clientid
Arc<str>
topic
&str
qos
QoS
flags
SubscriptionFlags