Considering the following operator, in the position representation: $$P:= \int _a ^ b dx | x \rangle \langle x|$$ It's an orthogonal projector.
Let's examine its action on the wave function $\psi$:
$(P\psi)(x)= \langle x | P\psi \rangle = \langle x | \displaystyle \int_a^b dx' | x' \rangle \langle x'| \psi \rangle = \int_a^b dx' \langle x | x' \rangle \langle x'| \psi \rangle = \int_a^b dx' \delta( x-x') \psi (x') = \begin{cases} \psi(x) & x\in [a, b] \\ 0 & {\rm otherwise} \end{cases} $
So it truncates the function in the interval of interest, which is a sort of "projection" in the continuous case.
Now, it can be shown (formally) that $\operatorname{rank}P = \operatorname {trace }P$ is infinite (hence $P$ is not trace-class).
$$\operatorname {trace} \left ( \int _a ^ b dx | x \rangle \langle x| \right ) = \int _a ^ b dx \operatorname{trace}\left (| x \rangle \langle x| \right ) = \int _a ^ b dx \langle x|x \rangle = \infty$$
But... what does it mean in terms of the standard definition of $\operatorname {rank} P$, that is, the dimension of the eigenspace on which $P$ acts as the identity operator? That there are an infinite amount of wave functions of this kind: \begin{cases} \psi(x) & x\in [a, b] \\ 0 & {\rm otherwise} \end{cases} , or what?