you are viewing a single comment's thread
view the rest of the comments
[–] [S] 16 points 2 years ago (1 child)

Well, if the only thing you need from reflection is the name of a type, so then yes. But I wouldn't really call this reflection since it is very limited.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 9 points 2 years ago (1 child)

    Yeah, Rust can't have proper reflection, since there's no external runtime environment that keeps track of your state. Any such smartness either has to be compiled-in (which is how std::any and macros work) or you can implement something to keep track of this state at runtime, as if you were partially building a runtime environment.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 13 points 2 years ago (2 children)

    Minor point of clarification: it can't have runtime reflection, but in principle it could have compile time reflection.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 0 points 2 years ago (2 children)

    No, the Rust Project recently made sure that Rust can't have compile-time reflection.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 2 years ago (1 child)

    Can you expand on this? I'd love to read more on the subject.

  • source
  • parent
  • hideshow 2 child comments