pub fn create_subscription<T, F>(
        &mut self,
        topic: &str,
        qos: QoSProfile,
        callback: F,
    ) -> Result<Arc<Subscription<T>>, RclReturnCode>
    where
        T: MessageDefinition<T> + Default,
        F: FnMut(&T) + Sized + 'static,
    {
        let subscription = Arc::new(Subscription::<T>::new(self, topic, qos, callback)?);
        self.subscriptions
            .push(Arc::downgrade(&subscription) as Weak<dyn SubscriptionBase>);
        Ok(subscription)
    }
// TODO: make subscription's lifetime depend on node's lifetime
make subscription's lifetime depend on node's lifetime
make subscription ' s lifetime depend on node ' s lifetime
pub fn create_subscription<T, F>(
        &mut self,
        topic: &str,
        qos: QoSProfile,
        callback: F,
    ) -> Result<Arc<Subscription<T>>, RclReturnCode>
    where
        T: MessageDefinition<T> + Default,
        F: FnMut(&T) + Sized + 'static,
    {
        let subscription = Arc::new(Subscription::<T>::new(self, topic, qos, callback)?);
        self.subscriptions
            .push(Arc::downgrade(&subscription) as Weak<dyn SubscriptionBase>);
        Ok(subscription)
    }
pub fn create_subscription < T , F > ( & mut self , topic : & str , qos : QoSProfile , callback : F , ) -> Result < Arc < Subscription < T > > , RclReturnCode > where T : MessageDefinition < T > + Default , F : FnMut ( & T ) + Sized + ' static , { let subscription = Arc :: new ( Subscription :: < T > :: new ( self , topic , qos , callback ) ? ) ; self . subscriptions . push ( Arc :: downgrade ( & subscription ) as Weak < dyn SubscriptionBase > ) ; Ok ( subscription ) }
TODO: make subscription's lifetime depend on node's lifetime
TODO : make subscription ' s lifetime depend on node ' s lifetime
&mut self
topic
&str
qos
QoSProfile
callback
F
&mut self
topic
&str
qos
QoSProfile
callback
F