The definition can be extended still further, to any category of spaces with a notion of compactness and Cauchy completion: a space is totally bounded if and only if its completion is compact.
The definition can be extended still further, to any category of spaces with a notion of compactness and Cauchy completion, using the "precompactness" characterisation below. That is, a space is totally bounded if and only if its completion is compact.