diff options
author | Alex Auvolat <alex@adnab.me> | 2021-10-15 11:05:09 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-10-19 23:38:42 +0200 |
commit | 65070f3c05775f6692f4a16b6a304991d0510301 (patch) | |
tree | aad55f988f3d29e3643e4141af6c53e79fd89257 /src/util/data.rs | |
parent | e6da0dc90098a7c830e14f6f0dce61e8e7132d3a (diff) | |
download | garage-65070f3c05775f6692f4a16b6a304991d0510301.tar.gz garage-65070f3c05775f6692f4a16b6a304991d0510301.zip |
Improvements to CLI and various fixes for netapp version
Diffstat (limited to 'src/util/data.rs')
-rw-r--r-- | src/util/data.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/data.rs b/src/util/data.rs index 6df51cd0..d4fe0009 100644 --- a/src/util/data.rs +++ b/src/util/data.rs @@ -87,6 +87,18 @@ impl FixedBytes32 { } } +impl From<netapp::NodeID> for FixedBytes32 { + fn from(node_id: netapp::NodeID) -> FixedBytes32 { + FixedBytes32::try_from(node_id.as_ref()).unwrap() + } +} + +impl Into<netapp::NodeID> for FixedBytes32 { + fn into(self) -> netapp::NodeID { + netapp::NodeID::from_slice(self.as_slice()).unwrap() + } +} + /// A 32 bytes UUID pub type Uuid = FixedBytes32; /// A 256 bit cryptographic hash, can be sha256 or blake2 depending on provenance |