Simulating the rope in a pulley

Hi, I’m new to this library (and even to rust itself) and I’m looking to simulate this following situation:
ropes_and_pulley_intro
I have set up the squares, circles and ground without a problem but I’m a bit lost in what I should use to simulate the rope and how the rope can be twisted into the pulley. I would appreciate if someone can tell me what i should explore and how to twist the rope.