Rust Conversion traits


  • AsRef and Borrow are similar but serve distinct purposes. Borrow is used to treat multiple borrowing methods similarly, or to treat borrowed values like their owned counterparts, while AsRef is used for genericizing references.
  • From<A> for B implies Into<B> for A, but not vice-versa.
  • From<A> for A is implicitly implemented.