pub struct UuidHelper;Expand description
Collection of helper functions for converting between Uuid type and its representations in
various FF-A containers.
Implementations§
Source§impl UuidHelper
impl UuidHelper
Sourcepub fn from_bytes(value: [u8; 16]) -> Uuid
pub fn from_bytes(value: [u8; 16]) -> Uuid
Converts byte array into Uuid.
Example:
- Input
[a1, a2, a3, a4, b1, b2, c1, c2, d1, d2, d3, d4, d5, d6, d7, d8] - Output:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8
Sourcepub fn to_bytes(value: Uuid) -> [u8; 16]
pub fn to_bytes(value: Uuid) -> [u8; 16]
Converts Uuid into byte array.
Example:
- Input:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8 - Output
[a1, a2, a3, a4, b1, b2, c1, c2, d1, d2, d3, d4, d5, d6, d7, d8]
Sourcepub fn from_u32_regs(value: [u32; 4]) -> Uuid
pub fn from_u32_regs(value: [u32; 4]) -> Uuid
Creates Uuid from four 32 bit register values.
Example:
- Input
[a4a3a2a1, c2c1b2b1, d4d3d2d1, d8d7d6d5] - Output:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8
Sourcepub fn to_u32_regs(value: Uuid) -> [u32; 4]
pub fn to_u32_regs(value: Uuid) -> [u32; 4]
Converts Uuid into four 32 bit register values.
Example:
- Input:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8 - Output
[a4a3a2a1, c2c1b2b1, d4d3d2d1, d8d7d6d5]
Sourcepub fn from_u64_regs(value: [u64; 2]) -> Uuid
pub fn from_u64_regs(value: [u64; 2]) -> Uuid
Creates Uuid from a 64 bit register pair.
Example:
- Input
[c2c1b2b1a4a3a2a1, d8d7d6d5d4d3d2d1] - Output:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8
Sourcepub fn to_u64_regs(value: Uuid) -> [u64; 2]
pub fn to_u64_regs(value: Uuid) -> [u64; 2]
Converts Uuid into a 64 bit register pair.
Example:
- Input
[c2c1b2b1a4a3a2a1, d8d7d6d5d4d3d2d1] - Output:
a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8
Auto Trait Implementations§
impl Freeze for UuidHelper
impl RefUnwindSafe for UuidHelper
impl Send for UuidHelper
impl Sync for UuidHelper
impl Unpin for UuidHelper
impl UnwindSafe for UuidHelper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more