Earlier quoted context omitted.
Because it is Rust code?!? "...An easy tutorial in Rust" A short visit to the authors blog clearly shows they know what they talk about.
It’s not just the language. That code is impossible to directly translate to a pixel shader because GPUs only implement fixed-function blending. Render target pixels (and depth values) are write-only in the graphics pipeline, they can be only loaded with fixed-function pieces of GPUs: blending, depth rejection, etc. It’s technically possible to translate the code into compute shader/CUDA/OpenCL/etc., but that gonna b…
For immediate mode renderers (IE desktop cards), VK_EXT_fragment_shader_interlock seems available to correct those "concurrency" issues. DX12 ROVs seem to expose similar abilities. Though performance may be hit more than tiling architectures.
So you can certainly read-modify-write framebuffer values in pixel shaders using current hardware, which is what is needed for a fully shader-driven blending step.