Had a couple users trip over the implementation detail that ros messages over the wire contain the "total message length" as their first 4 bytes, but rosbag and mcap files seem to omit to the total message length.
Have some examples for writing to a bag and reading from a bag with roslibrust.
https://github.com/newpavlov/rosbag-rs
Same with:
https://docs.rs/mcap/latest/mcap/