What does it mean by "fluid is at rest" when the constituent molecules are in random motion? The following definition is from the Wikipedia article on Hydrostatics:

Fluid statics or hydrostatics is the branch of fluid mechanics that studies "fluids at rest and the pressure in a fluid or exerted by a fluid on an immersed body".

We know that molecules of fluid are always in random motion. Then, what does "fluid is at rest" mean? How do we differentiate rest or motion of a fluid at the molecular level?
Is the state of rest or motion of a fluid defined with respect to the container in which it is present? If so, I don't understand how it includes fluid flowing in a fixed tube. I also tried thinking on the basis of motion of centre of mass of the molecules, but I don't see how it could differentiate rest or motion in the following case:

Centre of mass of the fluid always remains at the centre of the toroid irrespective of the state of motion or rest of the fluid.
 A: There is the thermodynamic frame, and when statistical mechanics was studied (a different frame) it was found mathematically that thermodynamic variables emerge from the statistical level accurately. When one mixes indiscriminately  two physics frameworks, conundrums and paradoxes result.
The terms "fluid" "solid" "gas" existed mathematically in thermodynamics long before the statistical particle frame was suspected. There is the fluid kinetic energy defined  here . Kinetic energy of the fluid is defined per volume element, which has nothing to do with the statistical mechanics level  of the particles in that volume. In this sense, one can think of a kinetic energy of the center of mass of the unit the volume, not of toroids.
Kinetic energy/volume= $1/2$ $mv^2/V$ = $1/2ρv^2$ where $ρ$ is the kinetic energy per unit volume.
Thus the state of rest of a fluid is defined when the kinetic energy per unit volume is zero. That the unit volume whether moving or not is made up of billions of particles randomly moving at that temperature and pressure (note these are thermodynamic variables) makes no difference to the thermodynamic equations.
A: Great question; I'm not too familiar with this topic, but here are my two cents.
When we observe phenomenon, rarely do we think about the movements of particles on a molecular level. When a water body is still, with no currents or ripples through it, we consider that water to be stagnant, or at rest.
So what about the vibrations, the atoms, the molecules? Don't all objects, even solids, move on a microscopic level? Most of the time, if we're referring to the object as a whole, we assume these vibrations to be negligible. Velocity is a good example; if water isn't flowing, we state its velocity to be zero. We don't care that each individual molecule of water has a velocity of its own, because when we pour that water somewhere, the molecules' velocities do not affect the overall velocity of water. Thus, we might say that an object with zero velocity is "at rest", or stationary.
In Hydrostatics, this is the case. The key difference is that the water being observed is not in motion on a macroscopic scale. Since molecules are always in motion, "at rest" just refers to the one "object" being still.
As for your question about the container, are you referring to liquids specifically, and how it flows depending on the container? As far as I'm concerned, the container has no effect on whether a fluid is in motion or not. The centre of mass of a fully filled pipe does not depend on the motion of the fluid as there is no change in position of the fluid.
Hope I was able to answer your question.
A: Fluid mechanics is a theory that is 'averaged over the velocity space of molecules'. That means that 'fluid velocity' and 'molecule velocity' are two completely different velocity concepts.
In the derivation of fluid mechanics from kinetic theory, to be found in fluid dynamics or plasma physics standard books, you will find that the fluid velocity $\vec u(x)$ at a point is related to the particle velocities $\vec v$, and the local particle velocity distribution function $f(\vec v,x)$ via
$$\vec u (\vec x)  = \int_{-\infty}^{\infty} \vec v\;\, f(\vec v, \vec x) dv$$
so, if $f(\vec v, \vec x)$ is a gaussian or any other symmetric function centered at $v=0$, the fluid can be at rest, i.e. $\vec u = \vec 0$, because $\vec v$ is an asymmetric function, and the integral of a antisymmetric times a symmetric function is zero.
So a fluid at rest, is at rest in the sense of the fluid average $\vec u$. When the fluid is in movement with some speed $\vec u = \vec v_{0}$, then this corresponds to a systematic shift of the distribution function $f\rightarrow f(\vec v + \vec v_0)$, so that all molecules keep bumping into each other, but have a nonzero average $\vec v_0$
