blob: 737d6f4296964cfa64899827932f6d81e7fab2db [file] [log] [blame]
Brian Silverman10599932022-08-15 06:05:53 -07001autocxx::include_cpp! (
2#include "aos/uuid.h"
3#include "aos/uuid_for_rust.h"
4
5safety!(unsafe)
6
7generate_pod!("aos::UUID")
8);
9
10pub use ffi::aos::UUID;
11
12impl From<UUID> for uuid::Uuid {
13 fn from(uuid: UUID) -> uuid::Uuid {
14 uuid::Uuid::from_bytes(uuid.data)
15 }
16}
17
18impl AsRef<uuid::Uuid> for UUID {
19 fn as_ref(&self) -> &uuid::Uuid {
20 uuid::Uuid::from_bytes_ref(&self.data)
21 }
22}
23
24impl From<uuid::Uuid> for UUID {
25 fn from(uuid: uuid::Uuid) -> UUID {
26 UUID {
27 data: *uuid.as_bytes(),
28 }
29 }
30}