rust to add uuid support
diff --git a/lib/rs/src/protocol/mod.rs b/lib/rs/src/protocol/mod.rs
index 019f717..0e47795 100644
--- a/lib/rs/src/protocol/mod.rs
+++ b/lib/rs/src/protocol/mod.rs
@@ -171,6 +171,8 @@
fn read_i64(&mut self) -> crate::Result<i64>;
/// Read a 64-bit float.
fn read_double(&mut self) -> crate::Result<f64>;
+ /// Read a UUID.
+ fn read_uuid(&mut self) -> crate::Result<uuid::Uuid>;
/// Read a fixed-length string (not null terminated).
fn read_string(&mut self) -> crate::Result<String>;
/// Read the beginning of a list.
@@ -323,6 +325,8 @@
fn write_i64(&mut self, i: i64) -> crate::Result<()>;
/// Write a 64-bit float.
fn write_double(&mut self, d: f64) -> crate::Result<()>;
+ /// Write a UUID
+ fn write_uuid(&mut self, uuid: &uuid::Uuid) -> crate::Result<()>;
/// Write a fixed-length string.
fn write_string(&mut self, s: &str) -> crate::Result<()>;
/// Write the beginning of a list.
@@ -405,6 +409,10 @@
(**self).read_double()
}
+ fn read_uuid(&mut self) -> crate::Result<uuid::Uuid> {
+ (**self).read_uuid()
+ }
+
fn read_string(&mut self) -> crate::Result<String> {
(**self).read_string()
}
@@ -498,6 +506,10 @@
(**self).write_double(d)
}
+ fn write_uuid(&mut self, uuid: &uuid::Uuid) -> crate::Result<()> {
+ (**self).write_uuid(uuid)
+ }
+
fn write_string(&mut self, s: &str) -> crate::Result<()> {
(**self).write_string(s)
}
@@ -823,8 +835,8 @@
List,
/// UTF-8 string.
Utf8,
- /// UTF-16 string. *Unsupported*.
- Utf16,
+ /// Uuid.
+ Uuid,
}
impl Display for TType {
@@ -845,7 +857,7 @@
TType::Set => write!(f, "set"),
TType::List => write!(f, "list"),
TType::Utf8 => write!(f, "UTF8"),
- TType::Utf16 => write!(f, "UTF16"),
+ TType::Uuid => write!(f, "UUID"),
}
}
}