diff --git a/src/lib.rs b/src/lib.rs index 28d401a..23f2a3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,6 +233,17 @@ impl Value { } None } + + /// Return the type. + pub fn kind(&self) -> Type { + match self { + &Value::Binary(_) => Type::Binary, + &Value::Float(_) => Type::Float, + &Value::Integer(_) => Type::Integer, + &Value::String(_) => Type::String, + &Value::Null => Type::Null, + } + } } mod connection;