vendredi 27 juillet 2018

How to Find caller of the function in Rust

I want to get the caller type in my function how can I do that in Rust?

impl A {
    fn call_function(){ my_function(); }
}    

impl B {
    pub fn my_function(){
      // Doing something
      // Does it possible to Get caller type which is A in this case?
    }
}





Aucun commentaire:

Enregistrer un commentaire