Feat/web (Patchset 4) (#460)

support basic functions in frontend
1. create/del network
2. inspect network running status
This commit is contained in:
Sijie.Sun
2024-11-08 23:33:17 +08:00
committed by GitHub
parent 8aca5851f2
commit e948dbfcc1
64 changed files with 11671 additions and 344 deletions
+10 -2
View File
@@ -7,13 +7,21 @@ include!(concat!(env!("OUT_DIR"), "/common.rs"));
impl From<uuid::Uuid> for Uuid {
fn from(uuid: uuid::Uuid) -> Self {
let (high, low) = uuid.as_u64_pair();
Uuid { low, high }
Uuid {
part1: (high >> 32) as u32,
part2: (high & 0xFFFFFFFF) as u32,
part3: (low >> 32) as u32,
part4: (low & 0xFFFFFFFF) as u32,
}
}
}
impl From<Uuid> for uuid::Uuid {
fn from(uuid: Uuid) -> Self {
uuid::Uuid::from_u64_pair(uuid.high, uuid.low)
uuid::Uuid::from_u64_pair(
(u64::from(uuid.part1) << 32) | u64::from(uuid.part2),
(u64::from(uuid.part3) << 32) | u64::from(uuid.part4),
)
}
}