From d88c091c503cd7ddacbe5d7c23abb98ed70f26e5 Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Tue, 4 Aug 2015 08:28:00 -0400 Subject: [PATCH] Add kind to Value --- src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;