Foreshadowing in literature occurs when the author gives a hint of what is going to occur. An instance of foreshadowing occurs as Peyton Farquhar stands on the bridge in part 1, waiting to be hanged. He looks down at water below. The narrator makes clear that is it rushing at a rapid pace, the "swirling water ... racing madly." However, to Peyton, it looks like it is moving "slowly." He calls it a "sluggish stream." This difference between fast-moving reality and Peyton's slow perception of it foreshadows how time will slow for him at the moment of death, allowing him to have a long, elaborate fantasy of escape.
The idea that real time will move much more quickly than the words recording Peyton's thoughts is foreshadowed a second time when we are told,
these thoughts, which have here to be set down in words, were flashed into the doomed man's brain rather than evolved from it.
In other words, the long linear sequence of language is not exactly how Peyton will experience his last images before death.
The revelation at the end of part 2 that the man dressed in gray who has made a polite call at the plantation asking for water is a union scout foreshadows the fact that Peyton has fallen, unbeknownst to him, into the trap that will cost him his life. It is, as well, a moment of dramatic irony, in which the reader knows what characters in a story do not.
The images in part 3 that Peyton fits to his escape fantasy foreshadow that he is, in reality, at the point of death by hanging, choking, his feet dangling in the air:
His tongue was swollen with thirst; he relieved its fever by thrusting it forward from between his teeth into the cold air. How softly the turf had carpeted the untraveled avenue—he could no longer feel the roadway beneath his feet!