pub fn cast_buffer<B1: PbBuffer, B2: PbBuffer>(buf: B1) -> Result<B2>
If B1 and B2 are the same type, returns the passed-in buffer; otherwise, returns an error.
B1
B2