[RFC] GUID byte-order
planetA opened this issue · comments
Hello,
ibv_get_device_guid
returns GUID in "network byte order" [1], which means big endian.
On another hand, the Rust counterpart returns u64, which I expect to be in the host byte order, which is little endian on my system. I would suggest to convert the result of the C version into host order. What would be your thoughts?
Hi, I created a pull request, which unfortunately does not work yet.
I tried to make a __be64
type as a tuple, so that it will not be convertible from u64
automatically. Unfortunately, it breaks ibv_gid
type with the following error message
warning: build failed, waiting for other jobs to finish...
error[E0308]: mismatched types
--> src/lib.rs:895:27
|
895 | raw: unsafe { gid.raw },
| ^^^^^^^ expected array `[u8; 16]`, found struct `__BindgenUnionField`
|
= note: expected array `[u8; 16]`
found struct `__BindgenUnionField<[u8; 16]>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
I'm still a newbie with Rust. Could you have a look at #16 to say if I'm moving in the right direction?