If you have a ring of functions from an open, connected subset of a metric space to another metric space, what is the most relaxed condition you can place on the functions that will make that ring an integral domain? Is it that the functions have to be analytic?

I only said metric space in order to exclude corner topological cases, but if you could relax that condition too, how would you do it?