Say a group of unscrupulous types have a PC captured after knocking him unconscious. They've tied his hands up and gagged him so he can't cast any more spells.
Is there anything in the rules stopping him from benefiting from a long or short rest (assuming his captors don't do anything further to disrupt the rest)?
If not, is there any restraint which would prevent resting? Feet tied as well, tied to a pole Return-of-the-Jedi style, locked up in a slightly-too-big Iron Maiden?
The in-game consequences of this are whether or not said PC feels much more confident trying various things to escape with full HP and resources, rather than 1 HP and not-full resources.
Best Answer
Yes, technically.
The rules for a Long Rest (PHB p. 186) state the following:
Right there are two restrictions that can prevent a player from finishing a long rest. Let's look at each one and how it could apply.
Restriction 1:
This could become relevant if the character is terrified of his or her captors. They would be constantly on the lookout from them coming back, and as such would be on edge for more than 2 hours at a time.
In the situation that the player would not be on the lookout for his/her captors, he/she would eventually need to sleep. Unfortunately, the PHB does not have rules on sleeping. Xanathar's Guide to Everything does however (p. 78).
If the player tried to keep staying awake, eventually they would rack up enough levels of exhaustion that they would just die. However, chances are they would pass out before then. That part is not technically RAW, but going from being extremely tired to dying is a bit of a leap.
Restriction 2:
This is how the captors would go about stopping a rest. Personally, I think things like having to balance, stand in one place, and things of that nature are all physically tiring, and as such would qualify as stopping a long-rest.
The captors could do something like put the player over a pool of ice water on a tiny platform that they have to actively stay on or fall into the water. They could do what you suggest and put them in an Iron-Maiden-esque device that would prevent the character from leaning against it.
As long as the character has to do something strenuous, they can't take a long rest or sleep. This is everything that affect how resting or sleeping work (to my knowledge).