If you're inevitably going to hit a boulder sideways when river canoeing, hug it! It's about to become your best friend. Lean your weight towards the boulder (not away from it!). This prevents the current from flipping the canoe upstream, filling it with water an wrapping around the boulder. Many types of canoes will simply be torn to pieces. Materials like plastic and some high quality composites will bend and conform to the boulder and would need to be unpinned and then hopefully reshaped.