Hirzebruch-Riemann-Roch as a categorical trace I