For example:
struct ABC { ... } impl ABC { fn some_method(&self) -> &str { // return the name of its struct -> "ABC" } }
In Python, I can get this using self.__class__.__name__. Is there anything similar in Rust?
self.__class__.__name__
Aucun commentaire:
Enregistrer un commentaire