Currently the Prefix type in cid crate does not include (mh_len) because it is very unhelpful and requires some data to be arbitrarily hashed to be determined, so I think the easiest solution would be to just add a function on top of the Cid type to generate the prefix bytes, but if the prefix needs to be reused and the mh_len is needed, that may need to be added back.
Task summary
Prefix to bytes generation is needed for Graphsync
Use go as a reference: https://github.com/ipfs/go-cid/blob/master/cid.go#L569
Currently the Prefix type in cid crate does not include (mh_len) because it is very unhelpful and requires some data to be arbitrarily hashed to be determined, so I think the easiest solution would be to just add a function on top of the Cid type to generate the prefix bytes, but if the prefix needs to be reused and the mh_len is needed, that may need to be added back.
Specification reference
Other information and links