Field-theoretical approach to quantum mechanics in curved spacetimes