In electrostatics, for several reasons, it seems that the correct way to understand the charge density $\rho$ isn't as a function $\rho : \mathbb{R}^3\to \mathbb{R}$, but rather as a distribution $\rho \in \mathcal{S}'(\mathbb{R}^3)$.
For example, denoting $\delta_{a}$ the Dirac delta centered at $a\in \mathbb{R}^3$ and defined by $(\delta_a,f)=f(a)$, a collection of point charges is then given by
$$\rho=\sum q_i \delta_{x_i}.$$
Here I'm using rigorous distribution theory, where tempered distributions are continuous linear functionals defined on the Schwartz space. So there isn't any $\rho(x)$, because $\rho$ isn't a function on $\mathbb{R}^3$, nor any $\delta(x-x_i)$, because $\delta_{x_i}$ also isn't a function on $\mathbb{R}^3$.
Now, the point is that since $\rho$ isn't a function on $\mathbb{R}^3$, differently than what is done in Physics, it cannot be integrated. Indeed,
$$Q=\int \rho(x)d^3x$$
is meaningless because $\rho$ isn't a function. Actually, even if one tried to say that this would be solved with a measure on the space of functions, this wouldn't help much. If that were the case, we would be able to integrate functions with distribution values, but $\rho$ isn't that. It is a single distribution generaling a function on $\mathbb{R}^3$.
The only thing we can do with $\rho$ is to apply to functions. Interestingly if we pick $f = 1$, we have $(\rho,f)=Q$ in the point charge case, however, this is not correct since $1\notin \mathcal{S}(\mathbb{R}^3)$ and hence $\rho$ can't act over it.
So my question is: given $\rho\in \mathcal{S}'(\mathbb{R}^3)$ the charge density considered as a tempered distribution, and considering we want to do things with mathematical rigor, how do we recover the charge $Q$ from $\rho$ since we can't integrate it?