concept loop in category rust

This is an excerpt from Manning's book Rust in Action.
Common control flow mechanisms, such as forloops and thecontinuekeyword.
The ampersand (
&) prefix tohaystackon line 5, e.g.&haystack, may look unfamiliar. The ampersand is acting as a unary operator that returns a reference tohaystack. For any typeT, the syntax&Treturns a read-only reference toT. A useful quirk of references to arrays is that they enable you to iterate over references to the elements of the array withforloops. In Rust terminology, when we use&Twe borrowT. A “borrowed” value outlives the scope that it is being used in. The concept of borrowing and its terminology are explained in detail during in chapter 4.
2.5.4.
loop: The basis for Rust’s looping constructsRust contains a
loopkeyword for providing more control thanforandwhile.loopwill execute a code block again and again, never stopping for a tea break.loopcontinues to execute until abreakkeyword is encountered or the program is terminated from the outside.loop { // ... }
loopis often seen when implementing long-running servers.loop { let requester, request = accept_request(); let result = process_request(request); send_response(requester, result); }