据我所知,Lwt_bytes 似乎使用与 Cstruct 相同的类型(或者可能使用 cstruct 本身),但出于某种原因,我不能让它们两者一起工作:
Lwt_io.write_from_exactly out b.Cstruct.buffer 0 16
Error: This expression has type
Cstruct.buffer =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout)
Bigarray.Array1.t
but an expression was expected of type bytes
字节不是完全相同的类型吗?我怎样才能做到这一点?为了方便 Cstruct.LE,我尝试使用 Cstruct 而不是 Lwt_bytes,这些字节似乎没有。谢谢